Chapter 10 Character Sets, Collations, Unicode Table of Contents 10.1 Character Sets and Collations in General ............................................................................... 1926 10.2 Character Sets and Collations in MySQL ............................................................................... 1927 10.2.1 Character Set Repertoire ............................................................................................ 1929 10.2.2 UTF-8 for Metadata .................................................................................................... 1931 10.3 Specifying Character Sets and Collations ............................................................................... 1932 10.3.1 Collation Naming Conventions .................................................................................... 1933 10.3.2 Server Character Set and Collation ............................................................................. 1934 10.3.3 Database Character Set and Collation ......................................................................... 1934 10.3.4 Table Character Set and Collation .............................................................................. 1936 10.3.5 Column Character Set and Collation ........................................................................... 1936 10.3.6 Character String Literal Character Set and Collation ..................................................... 1938 10.3.7 The National Character Set ........................................................................................ 1939 10.3.8 Character Set Introducers ........................................................................................... 1940 10.3.9 Examples of Character Set and Collation Assignment .................................................. 1942 10.3.10 Compatibility with Other DBMSs ................................................................................ 1943 10.4 Connection Character Sets and Collations ............................................................................. 1943 10.5 Configuring Application Character Set and Collation ............................................................... 1949 10.6 Error Message Character Set ................................................................................................ 1951 10.7 Column Character Set Conversion ......................................................................................... 1952 10.8 Collation Issues .................................................................................................................... 1953 10.8.1 Using COLLATE in SQL Statements ........................................................................... 1953 10.8.2 COLLATE Clause Precedence .................................................................................... 1954 10.8.3 Character Set and Collation Compatibility .................................................................... 1954 10.8.4 Collation Coercibility in Expressions ............................................................................ 1954 10.8.5 The binary Collation Compared to _bin Collations ........................................................ 1956 10.8.6 Examples of the Effect of Collation ............................................................................. 1958 10.8.7 Using Collation in INFORMATION_SCHEMA Searches ................................................ 1960 10.9 Unicode Support ................................................................................................................... 1962 10.9.1 The utf8mb4 Character Set (4-Byte UTF-8 Unicode Encoding) ...................................... 1963 10.9.2 The utf8mb3 Character Set (3-Byte UTF-8 Unicode Encoding) ...................................... 1964 10.9.3 The utf8 Character Set (Alias for utf8mb3) .................................................................. 1965 10.9.4 The ucs2 Character Set (UCS-2 Unicode Encoding) .................................................... 1965 10.9.5 The utf16 Character Set (UTF-16 Unicode Encoding) ................................................... 1965 10.9.6 The utf16le Character Set (UTF-16LE Unicode Encoding) ............................................ 1966 10.9.7 The utf32 Character Set (UTF-32 Unicode Encoding) ................................................... 1966 10.9.8 Converting Between 3-Byte and 4-Byte Unicode Character Sets ................................... 1966 10.10 Supported Character Sets and Collations ............................................................................. 1969 10.10.1 Unicode Character Sets ............................................................................................ 1970 10.10.2 West European Character Sets ................................................................................. 1977 10.10.3 Central European Character Sets .............................................................................. 1978 10.10.4 South European and Middle East Character Sets ....................................................... 1979 10.10.5 Baltic Character Sets ................................................................................................ 1980 10.10.6 Cyrillic Character Sets .............................................................................................. 1980 10.10.7 Asian Character Sets ................................................................................................ 1981 10.10.8 The Binary Character Set ......................................................................................... 1985 10.11 Restrictions on Character Sets ............................................................................................ 1987 10.12 Setting the Error Message Language ................................................................................... 1987 10.13 Adding a Character Set ....................................................................................................... 1988 1925