The two characters in the chart are in order by code point value because 0xff9d  < 0x10384 . And they are in order by utf8  value because 0xef  < 0xf0 . But they are not in order by utf16  value, if we use byte-by-byte comparison, because 0xff  > 0xd8 . 

So MySQL’s utf16_bin  collation is not “byte by byte.”  It is “by code point.”  When MySQL sees a supplementary-character encoding in utf16 , it converts to the character’s code-point value, and then compares. Therefore, utf8_bin  and utf16_bin  are the same ordering. This is consistent with the SQL:2008 standard requirement for a UCS_BASIC collation: “UCS_BASIC is a collation in which the ordering is determined entirely by the Unicode scalar values of the characters in the strings being sorted. It is applicable to the UCS character repertoire. Since every character repertoire is a subset of the UCS repertoire, the UCS_BASIC collation is potentially applicable to every character set. NOTE 11: The Unicode scalar value of a character is its code point treated as an unsigned integer.” 

If the character set is ucs2 , comparison is byte-by-byte, but ucs2  strings should not contain surrogates, anyway. 

## Miscellaneous Information 

The xxx _general_mysql500_ci  collations preserve the pre-5.1.24 ordering of the original xxx _general_ci  collations and permit upgrades for tables created before MySQL 5.1.24 (Bug #27877). 

## 10.10.2 West European Character Sets 

Western European character sets cover most West European languages, such as French, Spanish, Catalan, Basque, Portuguese, Italian, Albanian, Dutch, German, Danish, Swedish, Norwegian, Finnish, Faroese, Icelandic, Irish, Scottish, and English. 

• ascii  (US ASCII) collations: 

• ascii_bin 

• ascii_general_ci  (default) 

• cp850  (DOS West European) collations: 

• cp850_bin 

• cp850_general_ci  (default) 

• dec8  (DEC Western European) collations: 

• dec8_bin 

• dec8_swedish_ci  (default) 

• hp8  (HP Western European) collations: 

• hp8_bin 

• hp8_english_ci  (default) 

• latin1  (cp1252 West European) collations: 

• latin1_bin 

• latin1_danish_ci 

