2000 Adding a UCA Collation to a Unicode Character Set 10.14.4.2 LDML Syntax Supported in MySQL | name | phone | +------+------------------+ | Bar | +7-912-800-80-01 | +------+------------------+ 1 row in set (0.00 sec) Character Representation Syntax Rules This section describes the LDML syntax that MySQL recognizes. This is a subset of the syntax described in the LDML specification available at http://www.unicode.org/reports/tr35/, which should be consulted for further information. MySQL recognizes a large enough subset of the syntax that, in many cases, it is possible to download a collation definition from the Unicode Common Locale Data Repository and paste the relevant part (that is, the part between the  <rules>  and  </rules>  tags) into the MySQL  Index.xml file. The rules described here are all supported except that character sorting occurs only at the primary level. Rules that specify differences at secondary or higher sort levels are recognized (and thus can be included in collation definitions) but are treated as equality at the primary level. The MySQL server generates diagnostics when it finds problems while parsing the  Index.xml  file. See Section 10.14.4.3, “Diagnostics During Index.xml Parsing” . Characters named in LDML rules can be written literally or in  \u nnnn  format, where  nnnn  is the hexadecimal Unicode code point value. For example,  A  and  Æ  can be written literally or as  \u0041  and \u00E1 . Within hexadecimal values, the digits  A  through  F  are not case-sensitive;  \u00E1  and  \u00e1 are equivalent. For UCA 4.0.0 collations, hexadecimal notation can be used only for characters in the Basic Multilingual Plane, not for characters outside the BMP range of  0000  to  FFFF . For UCA 5.2.0 collations, hexadecimal notation can be used for any character. The  Index.xml  file itself should be written using UTF-8 encoding. LDML has reset rules and shift rules to specify character ordering. Orderings are given as a set of rules that begin with a reset rule that establishes an anchor point, followed by shift rules that indicate how characters sort relative to the anchor point. <p>G</p> Either of these rules specifies a primary shift rule for the  ’G’  character: •Use tertiary differences to distinguish lettercase variations. •Use secondary differences to distinguish accent variations. •Use primary differences to distinguish separate letters. •The  <p> ,  <s> , and  <t>  shift rules define primary, secondary, and tertiary differences of a character from another character: •A  <reset>  rule does not specify any ordering in and of itself. Instead, it “resets”  the ordering for subsequent shift rules to cause them to be taken in relation to a given character. Either of the following rules resets subsequent shift rules to be taken in relation to the letter  ’A’ : <reset>A</reset> <reset>\u0041</reset>