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?
-
1There is nice article about character encoding: en.wikipedia.org/wiki/Character_encodingPaya– Paya2010-06-08 11:25:45 +00:00Commented Jun 8, 2010 at 11:25
-
I found that term (binary character set) in Sybase documentation but it’s also used in MySQL terminology.Marvin Divo– Marvin Divo2010-06-09 07:16:37 +00:00Commented Jun 9, 2010 at 7:16
1 Answer
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 :)
3 Comments
binary, varbinary, blob) vs chracter strings (char, varchar, text) that have their charset explicitly set to binary?binary and char charset binary. MySQL interprets char with charset set to binary as synonym for binary.