<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="charset-collation-names">
      </a>
      12.3.1 Collation Naming Conventions
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045217948640">
  </a>
  <p>
   MySQL collation names follow these conventions:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      A collation name starts with the name of the character set
            with which it is associated, generally followed by one or
            more suffixes indicating other collation characteristics.
            For example,
      <code class="literal">
       utf8mb4_0900_ai_ci
      </code>
      and
      <code class="literal">
       latin1_swedish_ci
      </code>
      are collations for the
      <code class="literal">
       utf8mb4
      </code>
      and
      <code class="literal">
       latin1
      </code>
      character sets, respectively. The
      <code class="literal">
       binary
      </code>
      character set has a single collation, also named
      <code class="literal">
       binary
      </code>
      , with no suffixes.
     </p>
    </li>
    <li class="listitem">
     <p>
      A language-specific collation includes a locale code or
            language name. For example,
      <code class="literal">
       utf8mb4_tr_0900_ai_ci
      </code>
      and
      <code class="literal">
       utf8mb4_hu_0900_ai_ci
      </code>
      sort characters for
            the
      <code class="literal">
       utf8mb4
      </code>
      character set using the rules
            of Turkish and Hungarian, respectively.
      <code class="literal">
       utf8mb4_turkish_ci
      </code>
      and
      <code class="literal">
       utf8mb4_hungarian_ci
      </code>
      are similar but
            based on a less recent version of the Unicode Collation
            Algorithm.
     </p>
    </li>
    <li class="listitem">
     <p>
      Collation suffixes indicate whether a collation is
            case-sensitive, accent-sensitive, or kana-sensitive (or some
            combination thereof), or binary. The following table shows
            the suffixes used to indicate these characteristics.
     </p>
     <a class="indexterm" name="idm46045217935344">
     </a>
     <a class="indexterm" name="idm46045217934272">
     </a>
     <a class="indexterm" name="idm46045217932784">
     </a>
     <a class="indexterm" name="idm46045217931712">
     </a>
     <a class="indexterm" name="idm46045217930224">
     </a>
     <a class="indexterm" name="idm46045217929152">
     </a>
     <a class="indexterm" name="idm46045217927664">
     </a>
     <a class="indexterm" name="idm46045217926592">
     </a>
     <a class="indexterm" name="idm46045217925104">
     </a>
     <a class="indexterm" name="idm46045217924032">
     </a>
     <a class="indexterm" name="idm46045217922544">
     </a>
     <a class="indexterm" name="idm46045217921472">
     </a>
     <div class="table">
      <a name="charset-collation-sensitivity-suffixes">
      </a>
      <p class="title">
       <b>
        Table 12.1 Collation Suffix Meanings
       </b>
      </p>
      <div class="table-contents">
       <table summary="Collation suffixes that indicate lettercase sensitivity, accent sensitivity, kana sensitivity, binary.">
        <colgroup>
         <col style="width: 20%"/>
         <col style="width: 80%"/>
        </colgroup>
        <thead>
         <tr>
          <th>
           Suffix
          </th>
          <th>
           Meaning
          </th>
         </tr>
        </thead>
        <tbody>
         <tr>
          <td>
           <code class="literal">
            _ai
           </code>
          </td>
          <td>
           Accent-insensitive
          </td>
         </tr>
         <tr>
          <td>
           <code class="literal">
            _as
           </code>
          </td>
          <td>
           Accent-sensitive
          </td>
         </tr>
         <tr>
          <td>
           <code class="literal">
            _ci
           </code>
          </td>
          <td>
           Case-insensitive
          </td>
         </tr>
         <tr>
          <td>
           <code class="literal">
            _cs
           </code>
          </td>
          <td>
           Case-sensitive
          </td>
         </tr>
         <tr>
          <td>
           <code class="literal">
            _ks
           </code>
          </td>
          <td>
           Kana-sensitive
          </td>
         </tr>
         <tr>
          <td>
           <code class="literal">
            _bin
           </code>
          </td>
          <td>
           Binary
          </td>
         </tr>
        </tbody>
       </table>
      </div>
     </div>
     <br class="table-break"/>
     <p>
      For nonbinary collation names that do not specify accent
            sensitivity, it is determined by case sensitivity. If a
            collation name does not contain
      <code class="literal">
       _ai
      </code>
      or
      <code class="literal">
       _as
      </code>
      ,
      <code class="literal">
       _ci
      </code>
      in the name
            implies
      <code class="literal">
       _ai
      </code>
      and
      <code class="literal">
       _cs
      </code>
      in
            the name implies
      <code class="literal">
       _as
      </code>
      . For example,
      <code class="literal">
       latin1_general_ci
      </code>
      is explicitly
            case-insensitive and implicitly accent-insensitive,
      <code class="literal">
       latin1_general_cs
      </code>
      is explicitly
            case-sensitive and implicitly accent-sensitive, and
      <code class="literal">
       utf8mb4_0900_ai_ci
      </code>
      is explicitly
            case-insensitive and accent-insensitive.
     </p>
     <p>
      For Japanese collations, the
      <code class="literal">
       _ks
      </code>
      suffix
            indicates that a collation is kana-sensitive; that is, it
            distinguishes Katakana characters from Hiragana characters.
            Japanese collations without the
      <code class="literal">
       _ks
      </code>
      suffix are not kana-sensitive and treat Katakana and
            Hiragana characters equal for sorting.
     </p>
     <p>
      For the
      <code class="literal">
       binary
      </code>
      collation of the
      <code class="literal">
       binary
      </code>
      character set, comparisons are
            based on numeric byte values. For the
      <code class="literal">
       _bin
      </code>
      collation of a nonbinary character
            set, comparisons are based on numeric character code values,
            which differ from byte values for multibyte characters. For
            information about the differences between the
      <code class="literal">
       binary
      </code>
      collation of the
      <code class="literal">
       binary
      </code>
      character set and the
      <code class="literal">
       _bin
      </code>
      collations of nonbinary character
            sets, see
      <a class="xref" href="charset-binary-collations.html" title="12.8.5 The binary Collation Compared to _bin Collations">
       Section 12.8.5, “The binary Collation Compared to _bin Collations”
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      Collation names for Unicode character sets may include a
            version number to indicate the version of the Unicode
            Collation Algorithm (UCA) on which the collation is based.
            UCA-based collations without a version number in the name
            use the version-4.0.0 UCA weight keys. For example:
     </p>
     <div class="itemizedlist">
      <ul class="itemizedlist" style="list-style-type: circle; ">
       <li class="listitem">
        <p>
         <code class="literal">
          utf8mb4_0900_ai_ci
         </code>
         is based on UCA
                9.0.0 weight keys
                (
         <a class="ulink" href="http://www.unicode.org/Public/UCA/9.0.0/allkeys.txt" target="_blank">
          http://www.unicode.org/Public/UCA/9.0.0/allkeys.txt
         </a>
         ).
        </p>
       </li>
       <li class="listitem">
        <p>
         <code class="literal">
          utf8mb4_unicode_520_ci
         </code>
         is based on
                UCA 5.2.0 weight keys
                (
         <a class="ulink" href="http://www.unicode.org/Public/UCA/5.2.0/allkeys.txt" target="_blank">
          http://www.unicode.org/Public/UCA/5.2.0/allkeys.txt
         </a>
         ).
        </p>
       </li>
       <li class="listitem">
        <p>
         <code class="literal">
          utf8mb4_unicode_ci
         </code>
         (with no version
                named) is based on UCA 4.0.0 weight keys
                (
         <a class="ulink" href="http://www.unicode.org/Public/UCA/4.0.0/allkeys-4.0.0.txt" target="_blank">
          http://www.unicode.org/Public/UCA/4.0.0/allkeys-4.0.0.txt
         </a>
         ).
        </p>
       </li>
      </ul>
     </div>
    </li>
    <li class="listitem">
     <p>
      For Unicode character sets, the
      <code class="literal">
       <em class="replaceable">
        <code>
         xxx
        </code>
       </em>
       _general_mysql500_ci
      </code>
      collations preserve the pre-5.1.24 ordering of the original
      <code class="literal">
       <em class="replaceable">
        <code>
         xxx
        </code>
       </em>
       _general_ci
      </code>
      collations and permit upgrades for tables created before
            MySQL 5.1.24 (Bug #27877).
     </p>
    </li>
   </ul>
  </div>
 </div>
 <br/>
</div>
