<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="adding-collation-unicode-uca">
      </a>
      12.14.4 Adding a UCA Collation to a Unicode Character Set
     </h3>
    </div>
   </div>
  </div>
  <div class="toc">
   <dl class="toc">
    <dt>
     <span class="section">
      <a href="ldml-collation-example.html">
       12.14.4.1 Defining a UCA Collation Using LDML Syntax
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="ldml-rules.html">
       12.14.4.2 LDML Syntax Supported in MySQL
      </a>
     </span>
    </dt>
    <dt>
     <span class="section">
      <a href="collation-diagnostics.html">
       12.14.4.3 Diagnostics During Index.xml Parsing
      </a>
     </span>
    </dt>
   </dl>
  </div>
  <p>
   This section describes how to add a UCA collation for a Unicode
        character set by writing the
   <code class="literal">
    &lt;collation&gt;
   </code>
   element within a
   <code class="literal">
    &lt;charset&gt;
   </code>
   character set description in
        the MySQL
   <code class="filename">
    Index.xml
   </code>
   file. The procedure
        described here does not require recompiling MySQL. It uses a
        subset of the Locale Data Markup Language (LDML) specification,
        which is available at
   <a class="ulink" href="http://www.unicode.org/reports/tr35/" target="_blank">
    http://www.unicode.org/reports/tr35/
   </a>
   . With this
        method, you need not define the entire collation. Instead, you
        begin with an existing
   <span class="quote">
    “
    <span class="quote">
     base
    </span>
    ”
   </span>
   collation and
        describe the new collation in terms of how it differs from the
        base collation. The following table lists the base collations of
        the Unicode character sets for which UCA collations can be
        defined. It is not possible to create user-defined UCA
        collations for
   <code class="literal">
    utf16le
   </code>
   ; there is no
   <code class="literal">
    utf16le_unicode_ci
   </code>
   collation that would serve
        as the basis for such collations.
  </p>
  <div class="table">
   <a name="idm46045215121936">
   </a>
   <p class="title">
    <b>
     Table 12.4 MySQL Character Sets Available for User-Defined UCA Collations
    </b>
   </p>
   <div class="table-contents">
    <table summary="Unicode character sets for which user-defined UCA collations can be defined and their base collations.">
     <colgroup>
      <col style="width: 30%"/>
      <col style="width: 60%"/>
     </colgroup>
     <thead>
      <tr>
       <th>
        Character Set
       </th>
       <th>
        Base Collation
       </th>
      </tr>
     </thead>
     <tbody>
      <tr>
       <td>
        <code class="literal">
         utf8mb4
        </code>
       </td>
       <td>
        <code class="literal">
         utf8mb4_unicode_ci
        </code>
       </td>
      </tr>
      <tr>
       <td>
        <code class="literal">
         ucs2
        </code>
       </td>
       <td>
        <code class="literal">
         ucs2_unicode_ci
        </code>
       </td>
      </tr>
      <tr>
       <td>
        <code class="literal">
         utf16
        </code>
       </td>
       <td>
        <code class="literal">
         utf16_unicode_ci
        </code>
       </td>
      </tr>
      <tr>
       <td>
        <code class="literal">
         utf32
        </code>
       </td>
       <td>
        <code class="literal">
         utf32_unicode_ci
        </code>
       </td>
      </tr>
     </tbody>
    </table>
   </div>
  </div>
  <br class="table-break"/>
  <p>
   The following sections show how to add a collation that is
        defined using LDML syntax, and provide a summary of LDML rules
        supported in MySQL.
  </p>
 </div>
 <br/>
</div>
