<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="charset-gb18030">
      </a>
      12.10.7.2 The gb18030 Character Set
     </h4>
    </div>
   </div>
  </div>
  <p>
   In MySQL, the
   <code class="literal">
    gb18030
   </code>
   character set
          corresponds to the
   <em class="citetitle">
    Chinese National Standard GB
          18030-2005: Information technology — Chinese coded
          character set
   </em>
   , which is the official character set
          of the People's Republic of China (PRC).
  </p>
  <h5>
   <a name="idm46045215559328">
   </a>
   Characteristics of the MySQL gb18030 Character Set
  </h5>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      Supports all code points defined by the GB 18030-2005
              standard. Unassigned code points in the ranges
              (GB+8431A439, GB+90308130) and (GB+E3329A36, GB+EF39EF39)
              are treated as '
      <code class="literal">
       ?
      </code>
      ' (0x3F). Conversion
              of unassigned code points returns '
      <code class="literal">
       ?
      </code>
      '.
     </p>
    </li>
    <li class="listitem">
     <p>
      Supports UPPER and LOWER conversion for all GB18030 code
              points. Case folding defined by Unicode is also supported
              (based on
      <code class="filename">
       CaseFolding-6.3.0.txt
      </code>
      ).
     </p>
    </li>
    <li class="listitem">
     <p>
      Supports Conversion of data to and from other character
              sets.
     </p>
    </li>
    <li class="listitem">
     <p>
      Supports SQL statements such as
      <a class="link" href="set-names.html" title="15.7.6.3 SET NAMES Statement">
       <code class="literal">
        SET
              NAMES
       </code>
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      Supports comparison between
      <code class="literal">
       gb18030
      </code>
      strings, and between
      <code class="literal">
       gb18030
      </code>
      strings
              and strings of other character sets. There is a conversion
              if strings have different character sets. Comparisons that
              include or ignore trailing spaces are also supported.
     </p>
    </li>
    <li class="listitem">
     <p>
      The private use area (U+E000, U+F8FF) in Unicode is mapped
              to
      <code class="literal">
       gb18030
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      There is no mapping between (U+D800, U+DFFF) and GB18030.
              Attempted conversion of code points in this range returns
              '
      <code class="literal">
       ?
      </code>
      '.
     </p>
    </li>
    <li class="listitem">
     <p>
      If an incoming sequence is illegal, an error or warning is
              returned. If an illegal sequence is used in
      <code class="literal">
       CONVERT()
      </code>
      , an error is returned.
              Otherwise, a warning is returned.
     </p>
    </li>
    <li class="listitem">
     <p>
      For consistency with
      <code class="literal">
       utf8mb3
      </code>
      and
      <code class="literal">
       utf8mb4
      </code>
      , UPPER is not supported for
              ligatures.
     </p>
    </li>
    <li class="listitem">
     <p>
      Searches for ligatures also match uppercase ligatures when
              using the
      <code class="literal">
       gb18030_unicode_520_ci
      </code>
      collation.
     </p>
    </li>
    <li class="listitem">
     <p>
      If a character has more than one uppercase character, the
              chosen uppercase character is the one whose lowercase is
              the character itself.
     </p>
    </li>
    <li class="listitem">
     <p>
      The minimum multibyte length is 1 and the maximum is 4.
              The character set determines the length of a sequence
              using the first 1 or 2 bytes.
     </p>
    </li>
   </ul>
  </div>
  <h5>
   <a name="idm46045215537792">
   </a>
   Supported Collations
  </h5>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <code class="literal">
       gb18030_bin
      </code>
      : A binary collation.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       gb18030_chinese_ci
      </code>
      : The default
              collation, which supports Pinyin. Sorting of non-Chinese
              characters is based on the order of the original sort key.
              The original sort key is
      <code class="literal">
       GB(UPPER(ch))
      </code>
      if
      <code class="literal">
       UPPER(ch)
      </code>
      exists. Otherwise, the
              original sort key is
      <code class="literal">
       GB(ch)
      </code>
      . Chinese
              characters are sorted according to the Pinyin collation
              defined in the Unicode Common Locale Data Repository (CLDR
              24). Non-Chinese characters are sorted before Chinese
              characters with the exception of
      <code class="literal">
       GB+FE39FE39
      </code>
      , which is the code point
              maximum.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       gb18030_unicode_520_ci
      </code>
      : A Unicode
              collation. Use this collation if you need to ensure that
              ligatures are sorted correctly.
     </p>
    </li>
   </ul>
  </div>
 </div>
 <br/>
</div>
