5

I'm wondering what binary character set is and what is a difference from, let's say, ISO/IEC 8859-1 aka Latin-1 character set?

2
  • 1
    There is nice article about character encoding: en.wikipedia.org/wiki/Character_encoding Commented Jun 8, 2010 at 11:25
  • I found that term (binary character set) in Sybase documentation but it’s also used in MySQL terminology. Commented Jun 9, 2010 at 7:16

1 Answer 1

4

There's a page in the MySQL documentation about The _bin and binary Collations.

Nonbinary strings (as stored in the CHAR, VARCHAR, and TEXT data types) have a character set and collation. A given character set can have several collations, each of which defines a particular sorting and comparison order for the characters in the set. One of these is the binary collation for the character set, indicated by a _bin suffix in the collation name. For example, latin1 and utf8 have binary collations named latin1_bin and utf8_bin.

Binary strings (as stored in the BINARY, VARBINARY, and BLOB data types) have no character set or collation in the sense that nonbinary strings do. (Applied to a binary string, the CHARSET() and COLLATION() functions both return a value of binary.) Binary strings are sequences of bytes and the numeric values of those bytes determine sort order.

And so on. Maybe gives more sense? If not, I'd recommend looking further in the documentation for descriptions about these things. If it's a concept, it should be explained. Usually is :)

Sign up to request clarification or add additional context in comments.

3 Comments

What is the difference between binary strings (as stored in binary, varbinary, blob) vs chracter strings (char, varchar, text) that have their charset explicitly set to binary?
Binary is, well, for binary stuff. I'd use those for things like image data, binary hashes or whatever. Not strings and characters.
I've checked earlier on. There's no difference between binary and char charset binary. MySQL interprets char with charset set to binary as synonym for binary.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.