<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h2 class="title">
      <a name="faqs-cjk">
      </a>
      A.11 MySQL 8.4 FAQ: MySQL Chinese, Japanese, and Korean
Character Sets
     </h2>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045055655296">
  </a>
  <a class="indexterm" name="idm46045055653904">
  </a>
  <a class="indexterm" name="idm46045055652368">
  </a>
  <a class="indexterm" name="idm46045055650832">
  </a>
  <a class="indexterm" name="idm46045055649312">
  </a>
  <a class="indexterm" name="idm46045055647776">
  </a>
  <a class="indexterm" name="idm46045055646272">
  </a>
  <a class="indexterm" name="idm46045055645200">
  </a>
  <a class="indexterm" name="idm46045055643680">
  </a>
  <a class="indexterm" name="idm46045055642144">
  </a>
  <a class="indexterm" name="idm46045055640640">
  </a>
  <a class="indexterm" name="idm46045055639568">
  </a>
  <a class="indexterm" name="idm46045055638032">
  </a>
  <a class="indexterm" name="idm46045055636528">
  </a>
  <a class="indexterm" name="idm46045055635040">
  </a>
  <a class="indexterm" name="idm46045055633520">
  </a>
  <a class="indexterm" name="idm46045055632016">
  </a>
  <a class="indexterm" name="idm46045055630944">
  </a>
  <a class="indexterm" name="idm46045055629408">
  </a>
  <a class="indexterm" name="idm46045055627904">
  </a>
  <a class="indexterm" name="idm46045055626832">
  </a>
  <a class="indexterm" name="idm46045055625312">
  </a>
  <a class="indexterm" name="idm46045055623808">
  </a>
  <a class="indexterm" name="idm46045055622720">
  </a>
  <a class="indexterm" name="idm46045055621200">
  </a>
  <a class="indexterm" name="idm46045055619696">
  </a>
  <a class="indexterm" name="idm46045055618192">
  </a>
  <a class="indexterm" name="idm46045055616672">
  </a>
  <a class="indexterm" name="idm46045055615168">
  </a>
  <a class="indexterm" name="idm46045055613648">
  </a>
  <a class="indexterm" name="idm46045055612128">
  </a>
  <a class="indexterm" name="idm46045055610624">
  </a>
  <a class="indexterm" name="idm46045055609120">
  </a>
  <a class="indexterm" name="idm46045055607616">
  </a>
  <a class="indexterm" name="idm46045055606112">
  </a>
  <a class="indexterm" name="idm46045055604608">
  </a>
  <a class="indexterm" name="idm46045055603104">
  </a>
  <a class="indexterm" name="idm46045055601600">
  </a>
  <a class="indexterm" name="idm46045055600096">
  </a>
  <a class="indexterm" name="idm46045055598592">
  </a>
  <a class="indexterm" name="idm46045055597088">
  </a>
  <a class="indexterm" name="idm46045055595584">
  </a>
  <a class="indexterm" name="idm46045055594080">
  </a>
  <a class="indexterm" name="idm46045055593008">
  </a>
  <a class="indexterm" name="idm46045055591488">
  </a>
  <a class="indexterm" name="idm46045055589968">
  </a>
  <a class="indexterm" name="idm46045055588448">
  </a>
  <a class="indexterm" name="idm46045055586944">
  </a>
  <a class="indexterm" name="idm46045055585456">
  </a>
  <a class="indexterm" name="idm46045055583968">
  </a>
  <p>
   This set of Frequently Asked Questions derives from the experience
      of MySQL's Support and Development groups in handling many
      inquiries about CJK (Chinese-Japanese-Korean) issues.
  </p>
  <div class="qandaset">
   <a name="idm46045055581872">
   </a>
   <dl>
    <dt>
     A.11.1.
     <a href="faqs-cjk.html#faq-cjk-what-cjk-avail">
      What CJK character sets are available in MySQL?
     </a>
    </dt>
    <dt>
     A.11.2.
     <a href="faqs-cjk.html#faq-cjk-why-cjk-question-marks">
      I have inserted CJK characters into my table. Why does
        SELECT display them as
        “?” characters?
     </a>
    </dt>
    <dt>
     A.11.3.
     <a href="faqs-cjk.html#faq-cjk-what-problems-big5">
      What problems should I be aware of when working with the Big5
        Chinese character set?
     </a>
    </dt>
    <dt>
     A.11.4.
     <a href="faqs-cjk.html#faq-cjk-what-japanese-chars-fail">
      Why do Japanese character set conversions fail?
     </a>
    </dt>
    <dt>
     A.11.5.
     <a href="faqs-cjk.html#faq-cjk-how-convert-81ca-cp932">
      What should I do if I want to convert SJIS
        81CA to cp932?
     </a>
    </dt>
    <dt>
     A.11.6.
     <a href="faqs-cjk.html#faq-cjk-how-represent-yen">
      How does MySQL represent the Yen (¥) sign?
     </a>
    </dt>
    <dt>
     A.11.7.
     <a href="faqs-cjk.html#faq-cjk-what-problems-korean">
      Of what issues should I be aware when working with Korean
        character sets in MySQL?
     </a>
    </dt>
    <dt>
     A.11.8.
     <a href="faqs-cjk.html#faq-cjk-why-incorrect-string-value">
      Why do I get Incorrect string value error
        messages?
     </a>
    </dt>
    <dt>
     A.11.9.
     <a href="faqs-cjk.html#faq-cjk-why-gui-not-display-cjk">
      Why does my GUI front end or browser display CJK characters
        incorrectly in my application using Access, PHP, or another API?
     </a>
    </dt>
    <dt>
     A.11.10.
     <a href="faqs-cjk.html#faq-cjk-how-use-4-0-charset">
      I've upgraded to MySQL 8.4. How can I revert to
        behavior like that in MySQL 4.0 with regard to character sets?
     </a>
    </dt>
    <dt>
     A.11.11.
     <a href="faqs-cjk.html#faq-cjk-why-cjk-fail-searches">
      Why do some LIKE and
        FULLTEXT searches with CJK characters fail?
     </a>
    </dt>
    <dt>
     A.11.12.
     <a href="faqs-cjk.html#faq-cjk-how-know-avail-characters">
      How do I know whether character X is
        available in all character sets?
     </a>
    </dt>
    <dt>
     A.11.13.
     <a href="faqs-cjk.html#faq-cjk-how-cjk-sort-unicode-1">
      Why do CJK strings sort incorrectly in Unicode? (I)
     </a>
    </dt>
    <dt>
     A.11.14.
     <a href="faqs-cjk.html#faq-cjk-how-cjk-sort-unicode-2">
      Why do CJK strings sort incorrectly in Unicode? (II)
     </a>
    </dt>
    <dt>
     A.11.15.
     <a href="faqs-cjk.html#faq-cjk-why-supplement-char-rejected">
      Why are my supplementary characters rejected by MySQL?
     </a>
    </dt>
    <dt>
     A.11.16.
     <a href="faqs-cjk.html#faq-cjk-why-cjk-not-cjkv">
      Should “CJK” be “CJKV”?
     </a>
    </dt>
    <dt>
     A.11.17.
     <a href="faqs-cjk.html#faq-cjk-how-cjk-db-table-names">
      Does MySQL permit CJK characters to be used in database and
        table names?
     </a>
    </dt>
    <dt>
     A.11.18.
     <a href="faqs-cjk.html#faq-cjk-where-doc-translations">
      Where can I find translations of the MySQL Manual into Chinese,
        Japanese, and Korean?
     </a>
    </dt>
    <dt>
     A.11.19.
     <a href="faqs-cjk.html#faq-cjk-help-with-cjk">
      Where can I get help with CJK and related issues in MySQL?
     </a>
    </dt>
   </dl>
   <table border="0" style="width: 100%;">
    <colgroup>
     <col align="left" width="1%"/>
     <col/>
    </colgroup>
    <tbody>
     <tr class="question">
      <td align="left" valign="top">
       <a name="faq-cjk-what-cjk-avail">
       </a>
       <a name="idm46045055581104">
       </a>
       <p>
        <b>
         A.11.1.
        </b>
       </p>
      </td>
      <td align="left" valign="top">
       <p>
        What CJK character sets are available in MySQL?
       </p>
      </td>
     </tr>
     <tr class="answer">
      <td align="left" valign="top">
      </td>
      <td align="left" valign="top">
       <p>
        The list of CJK character sets may vary depending on your MySQL
        version. For example, the
        <code class="literal">
         gb18030
        </code>
        character
        set is not supported prior to MySQL 5.7.4. However, since the
        name of the applicable language appears in the
        <code class="literal">
         DESCRIPTION
        </code>
        column for every entry in the
        <a class="link" href="information-schema-character-sets-table.html" title="28.3.4 The INFORMATION_SCHEMA CHARACTER_SETS Table">
         <code class="literal">
          INFORMATION_SCHEMA.CHARACTER_SETS
         </code>
        </a>
        table, you can obtain a current list of all the non-Unicode CJK
        character sets using this query:
       </p>
       <div class="copytoclipboard-wrapper">
        <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa17893801"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">SELECT</span> CHARACTER_SET_NAME<span class="token punctuation">,</span> <span class="token keyword">DESCRIPTION</span>
       <span class="token keyword">FROM</span> INFORMATION_SCHEMA<span class="token punctuation">.</span>CHARACTER_SETS
       <span class="token keyword">WHERE</span> <span class="token keyword">DESCRIPTION</span> <span class="token operator">LIKE</span> <span class="token string">'%Chin%'</span>
       <span class="token operator">OR</span> <span class="token keyword">DESCRIPTION</span> <span class="token operator">LIKE</span> <span class="token string">'%Japanese%'</span>
       <span class="token operator">OR</span> <span class="token keyword">DESCRIPTION</span> <span class="token operator">LIKE</span> <span class="token string">'%Korean%'</span>
       <span class="token keyword">ORDER</span> <span class="token keyword">BY</span> CHARACTER_SET_NAME<span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> CHARACTER_SET_NAME <span class="token punctuation">|</span> DESCRIPTION                     <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> big5               <span class="token punctuation">|</span> Big5 Traditional Chinese        <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> cp932              <span class="token punctuation">|</span> SJIS for Windows Japanese       <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> eucjpms            <span class="token punctuation">|</span> UJIS for Windows Japanese       <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> euckr              <span class="token punctuation">|</span> EUC<span class="token punctuation">-</span>KR Korean                   <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> gb18030            <span class="token punctuation">|</span> China National Standard GB18030 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> gb2312             <span class="token punctuation">|</span> GB2312 Simplified Chinese       <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> gbk                <span class="token punctuation">|</span> GBK Simplified Chinese          <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> sjis               <span class="token punctuation">|</span> Shift<span class="token punctuation">-</span>JIS Japanese              <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> ujis               <span class="token punctuation">|</span> EUC<span class="token punctuation">-</span>JP Japanese                 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span></code></pre>
       </div>
       <p>
        (For more information, see
        <a class="xref" href="information-schema-character-sets-table.html" title="28.3.4 The INFORMATION_SCHEMA CHARACTER_SETS Table">
         Section 28.3.4, “The INFORMATION_SCHEMA CHARACTER_SETS Table”
        </a>
        .)
       </p>
       <p>
        MySQL supports three variants of the
        <span class="firstterm">
         GB
        </span>
        (
        <span class="foreignphrase">
         <em class="foreignphrase">
          Guojia
        Biaozhun
         </em>
        </span>
        , or
        <span class="emphasis">
         <em>
          National
        Standard
         </em>
        </span>
        , or
        <span class="emphasis">
         <em>
          Simplified Chinese
         </em>
        </span>
        )
        character sets which are official in the People's Republic of
        China:
        <code class="literal">
         gb2312
        </code>
        ,
        <code class="literal">
         gbk
        </code>
        , and
        (as of MySQL 5.7.4)
        <code class="literal">
         gb18030
        </code>
        .
       </p>
       <p>
        Sometimes people try to insert
        <code class="literal">
         gbk
        </code>
        characters
        into
        <code class="literal">
         gb2312
        </code>
        , and it works most of the time
        because
        <code class="literal">
         gbk
        </code>
        is a superset of
        <code class="literal">
         gb2312
        </code>
        . But eventually they try to insert a
        rarer Chinese character and it does not work. (For an example,
        see Bug #16072).
       </p>
       <p>
        Here, we try to clarify exactly what characters are legitimate
        in
        <code class="literal">
         gb2312
        </code>
        or
        <code class="literal">
         gbk
        </code>
        , with
        reference to the official documents. Please check these
        references before reporting
        <code class="literal">
         gb2312
        </code>
        or
        <code class="literal">
         gbk
        </code>
        bugs:
       </p>
       <div class="itemizedlist">
        <ul class="itemizedlist" style="list-style-type: disc; ">
         <li class="listitem">
          <p>
           The MySQL
           <code class="literal">
            gbk
           </code>
           character set is in reality
           <span class="quote">
            “
            <span class="quote">
             Microsoft code page 936
            </span>
            ”
           </span>
           . This differs from
            the official
           <code class="literal">
            gbk
           </code>
           for characters
           <code class="literal">
            A1A4
           </code>
           (middle dot),
           <code class="literal">
            A1AA
           </code>
           (em dash),
           <code class="literal">
            A6E0-A6F5
           </code>
           , and
           <code class="literal">
            A8BB-A8C0
           </code>
           .
          </p>
         </li>
         <li class="listitem">
          <p>
           For a listing of
           <code class="literal">
            gbk
           </code>
           /Unicode mappings,
            see
           <a class="ulink" href="http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP936.TXT" target="_blank">
            http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP936.TXT
           </a>
           .
          </p>
         </li>
        </ul>
       </div>
       <p>
        It is also possible to store CJK characters in Unicode character
        sets, although the available collations may not sort characters
        quite as you expect:
       </p>
       <div class="itemizedlist">
        <ul class="itemizedlist" style="list-style-type: disc; ">
         <li class="listitem">
          <p>
           The
           <code class="literal">
            utf8
           </code>
           and
           <code class="literal">
            ucs2
           </code>
           character sets support the characters from Unicode Basic
            Multilingual Plane (BMP). These characters have code point
            values between
           <code class="literal">
            U+0000
           </code>
           and
           <code class="literal">
            U+FFFF
           </code>
           .
          </p>
         </li>
         <li class="listitem">
          <p>
           The
           <code class="literal">
            utf8mb4
           </code>
           ,
           <code class="literal">
            utf16
           </code>
           ,
           <code class="literal">
            utf16le
           </code>
           , and
           <code class="literal">
            utf32
           </code>
           character sets support BMP characters, as well as
            supplementary characters that lie outside the BMP.
            Supplementary characters have code point values between
           <code class="literal">
            U+10000
           </code>
           and
           <code class="literal">
            U+10FFFF
           </code>
           .
          </p>
         </li>
        </ul>
       </div>
       <p>
        The collation used for a Unicode character set determines the
        ability to sort (that is, distinguish) characters in the set:
       </p>
       <div class="itemizedlist">
        <ul class="itemizedlist" style="list-style-type: disc; ">
         <li class="listitem">
          <p>
           Collations based on Unicode Collation Algorithm (UCA) 4.0.0
            distinguish only BMP characters.
          </p>
         </li>
         <li class="listitem">
          <p>
           Collations based on UCA 5.2.0 or 9.0.0 distinguish BMP and
            supplementary characters.
          </p>
         </li>
         <li class="listitem">
          <p>
           Non-UCA collations may not distinguish all Unicode
            characters. For example, the
           <code class="literal">
            utf8mb4
           </code>
           default collation is
           <code class="literal">
            utf8mb4_general_ci
           </code>
           ,
            which distinguishes only BMP characters.
          </p>
         </li>
        </ul>
       </div>
       <p>
        Moreover, distinguishing characters is not the same as ordering
        them per the conventions of a given CJK language. Currently,
        MySQL has only one CJK-specific UCA collation,
        <code class="literal">
         gb18030_unicode_520_ci
        </code>
        (which requires use of
        the non-Unicode
        <code class="literal">
         gb18030
        </code>
        character set).
       </p>
       <p>
        For information about Unicode collations and their
        differentiating properties, including collation properties for
        supplementary characters, see
        <a class="xref" href="charset-unicode-sets.html" title="12.10.1 Unicode Character Sets">
         Section 12.10.1, “Unicode Character Sets”
        </a>
        .
       </p>
      </td>
     </tr>
     <tr class="question">
      <td align="left" valign="top">
       <a name="faq-cjk-why-cjk-question-marks">
       </a>
       <a name="idm46045055530752">
       </a>
       <p>
        <b>
         A.11.2.
        </b>
       </p>
      </td>
      <td align="left" valign="top">
       <p>
        I have inserted CJK characters into my table. Why does
        <a class="link" href="select.html" title="15.2.13 SELECT Statement">
         <code class="literal">
          SELECT
         </code>
        </a>
        display them as
        <span class="quote">
         “
         <span class="quote">
          ?
         </span>
         ”
        </span>
        characters?
       </p>
      </td>
     </tr>
     <tr class="answer">
      <td align="left" valign="top">
      </td>
      <td align="left" valign="top">
       <p>
        This problem is usually due to a setting in MySQL that does not
        match the settings for the application program or the operating
        system. Here are some common steps for correcting these types of
        issues:
       </p>
       <div class="itemizedlist">
        <ul class="itemizedlist" style="list-style-type: disc; ">
         <li class="listitem">
          <p>
           <span class="emphasis">
            <em>
             Be certain of what MySQL version you are
            using
            </em>
           </span>
           .
          </p>
          <p>
           Use the statement
           <code class="literal">
            SELECT VERSION();
           </code>
           to
            determine this.
          </p>
         </li>
         <li class="listitem">
          <p>
           <span class="emphasis">
            <em>
             Make sure that the database is actually using the
            desired character set
            </em>
           </span>
           .
          </p>
          <p>
           People often think that the client character set is always
            the same as either the server character set or the character
            set used for display purposes. However, both of these are
            false assumptions. You can make sure by checking the result
            of
           <code class="literal">
            SHOW CREATE TABLE
            <em class="replaceable">
             <code>
              tablename
             </code>
            </em>
           </code>
           or, better
            yet, by using this statement:
          </p>
          <div class="copytoclipboard-wrapper">
           <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa15163097"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">SELECT</span> character_set_name<span class="token punctuation">,</span> collation_name
    <span class="token keyword">FROM</span> information_schema<span class="token punctuation">.</span><span class="token keyword">columns</span>
    <span class="token keyword">WHERE</span> table_schema <span class="token operator">=</span> your_database_name
        <span class="token operator">AND</span> <span class="token keyword">table_name</span> <span class="token operator">=</span> your_table_name
        <span class="token operator">AND</span> <span class="token keyword">column_name</span> <span class="token operator">=</span> your_column_name<span class="token punctuation">;</span></code></pre>
          </div>
         </li>
         <li class="listitem">
          <p>
           <span class="emphasis">
            <em>
             Determine the hexadecimal value of the character
            or characters that are not being displayed
            correctly
            </em>
           </span>
           .
          </p>
          <p>
           You can obtain this information for a column
           <em class="replaceable">
            <code>
             column_name
            </code>
           </em>
           in the table
           <em class="replaceable">
            <code>
             table_name
            </code>
           </em>
           using the following
            query:
          </p>
          <div class="copytoclipboard-wrapper">
           <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa22121110"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">SELECT</span> <span class="token function">HEX</span><span class="token punctuation">(</span><span class="token keyword"><em class="replaceable">column_name</em></span><span class="token punctuation">)</span>
<span class="token keyword">FROM</span> <span class="token keyword"><em class="replaceable">table_name</em></span><span class="token punctuation">;</span></code></pre>
          </div>
          <p>
           <code class="literal">
            3F
           </code>
           is the encoding for the
           <code class="literal">
            ?
           </code>
           character; this means that
           <code class="literal">
            ?
           </code>
           is the character actually stored in the
            column. This most often happens because of a problem
            converting a particular character from your client character
            set to the target character set.
          </p>
         </li>
         <li class="listitem">
          <p>
           <span class="emphasis">
            <em>
             Make sure that a round trip is possible. When you
            select
             <em class="replaceable">
              <code>
               literal
              </code>
             </em>
             (or
             <em class="replaceable">
              <code>
               _introducer hexadecimal-value
              </code>
             </em>
             ),
            do you obtain
             <em class="replaceable">
              <code>
               literal
              </code>
             </em>
             as a
            result
            </em>
           </span>
           ?
          </p>
          <p>
           For example, the Japanese Katakana character
           <span class="foreignphrase">
            <em class="foreignphrase">
             Pe
            </em>
           </span>
           (
           <code class="literal">
            ペ'
           </code>
           )
            exists in all CJK character sets, and has the code point
            value (hexadecimal coding)
           <code class="literal">
            0x30da
           </code>
           . To
            test a round trip for this character, use this query:
          </p>
          <div class="copytoclipboard-wrapper">
           <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa55980499"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">SELECT</span> <span class="token string">'ペ'</span> <span class="token keyword">AS</span> <span class="token punctuation">`</span>ペ<span class="token punctuation">`</span><span class="token punctuation">;</span>         <span class="token comment" spellcheck="true">/* or SELECT _ucs2 0x30da; */</span></code></pre>
          </div>
          <p>
           If the result is not also
           <code class="literal">
            ペ
           </code>
           , the round
            trip failed.
          </p>
          <p>
           For bug reports regarding such failures, we might ask you to
            follow up with
           <code class="literal">
            SELECT HEX('ペ');
           </code>
           . Then
            we can determine whether the client encoding is correct.
          </p>
         </li>
         <li class="listitem">
          <p>
           <span class="emphasis">
            <em>
             Make sure that the problem is not with the browser
            or other application, rather than with MySQL
            </em>
           </span>
           .
          </p>
          <p>
           Use the
           <a class="link" href="mysql.html" title="6.5.1 mysql — The MySQL Command-Line Client">
            <span class="command">
             <strong>
              mysql
             </strong>
            </span>
           </a>
           client program to
            accomplish this task. If
           <a class="link" href="mysql.html" title="6.5.1 mysql — The MySQL Command-Line Client">
            <span class="command">
             <strong>
              mysql
             </strong>
            </span>
           </a>
           displays
            characters correctly but your application does not, your
            problem is probably due to system settings.
          </p>
          <p>
           To determine your settings, use the
           <a class="link" href="show-variables.html" title="15.7.7.41 SHOW VARIABLES Statement">
            <code class="literal">
             SHOW VARIABLES
            </code>
           </a>
           statement,
            whose output should resemble what is shown here:
          </p>
          <div class="copytoclipboard-wrapper">
           <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa78869933"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">SHOW</span> <span class="token keyword">VARIABLES</span> <span class="token operator">LIKE</span> <span class="token string">'char%'</span><span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> Variable_name            <span class="token punctuation">|</span> Value                                  <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> character_set_client     <span class="token punctuation">|</span> utf8                                   <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> character_set_connection <span class="token punctuation">|</span> utf8                                   <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> character_set_database   <span class="token punctuation">|</span> latin1                                 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> character_set_filesystem <span class="token punctuation">|</span> binary                                 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> character_set_results    <span class="token punctuation">|</span> utf8                                   <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> character_set_server     <span class="token punctuation">|</span> latin1                                 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> character_set_system     <span class="token punctuation">|</span> utf8                                   <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> character_sets_dir       <span class="token punctuation">|</span> /usr/local/mysql/share/mysql/charsets/ <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span></code></pre>
          </div>
          <p>
           These are typical character-set settings for an
            international-oriented client (notice the use of
           <code class="literal">
            utf8
           </code>
           Unicode) connected to a server in
            the West (
           <code class="literal">
            latin1
           </code>
           is a West Europe
            character set).
          </p>
          <p>
           Although Unicode (usually the
           <code class="literal">
            utf8
           </code>
           variant on Unix, and the
           <code class="literal">
            ucs2
           </code>
           variant on
            Windows) is preferable to Latin, it is often not what your
            operating system utilities support best. Many Windows users
            find that a Microsoft character set, such as
           <code class="literal">
            cp932
           </code>
           for Japanese Windows, is suitable.
          </p>
          <p>
           If you cannot control the server settings, and you have no
            idea what setting your underlying computer uses, try
            changing to a common character set for the country that
            you're in (
           <code class="literal">
            euckr
           </code>
           = Korea;
           <code class="literal">
            gb18030
           </code>
           ,
           <code class="literal">
            gb2312
           </code>
           or
           <code class="literal">
            gbk
           </code>
           = People's Republic of China;
           <code class="literal">
            big5
           </code>
           = Taiwan;
           <code class="literal">
            sjis
           </code>
           ,
           <code class="literal">
            ujis
           </code>
           ,
           <code class="literal">
            cp932
           </code>
           , or
           <code class="literal">
            eucjpms
           </code>
           = Japan;
           <code class="literal">
            ucs2
           </code>
           or
           <code class="literal">
            utf8
           </code>
           = anywhere). Usually it is
            necessary to change only the client and connection and
            results settings. The
           <a class="link" href="set-names.html" title="15.7.6.3 SET NAMES Statement">
            <code class="literal">
             SET
            NAMES
            </code>
           </a>
           . statement changes all three at once. For
            example:
          </p>
          <div class="copytoclipboard-wrapper">
           <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa47293035"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">SET</span> <span class="token keyword">NAMES</span> <span class="token string">'big5'</span><span class="token punctuation">;</span></code></pre>
          </div>
          <p>
           Once the setting is correct, you can make it permanent by
            editing
           <code class="filename">
            my.cnf
           </code>
           or
           <code class="filename">
            my.ini
           </code>
           . For example you might add lines
            looking like these:
          </p>
          <div class="copytoclipboard-wrapper">
           <pre class="programlisting language-ini"><div class="docs-select-all right" id="sa79722017"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-ini"><span class="token selector">[mysqld]</span>
<span class="token constant">character-set-server</span><span class="token attr-value"><span class="token punctuation">=</span>big5</span>
<span class="token selector">[client]</span>
<span class="token constant">default-character-set</span><span class="token attr-value"><span class="token punctuation">=</span>big5</span></code></pre>
          </div>
          <p>
           It is also possible that there are issues with the API
            configuration setting being used in your application; see
           <em class="citetitle">
            Why does my GUI front end or browser not display
            CJK characters correctly...?
           </em>
           for more
            information.
          </p>
         </li>
        </ul>
       </div>
      </td>
     </tr>
     <tr class="question">
      <td align="left" valign="top">
       <a name="faq-cjk-what-problems-big5">
       </a>
       <a name="idm46045055475504">
       </a>
       <p>
        <b>
         A.11.3.
        </b>
       </p>
      </td>
      <td align="left" valign="top">
       <p>
        What problems should I be aware of when working with the Big5
        Chinese character set?
       </p>
      </td>
     </tr>
     <tr class="answer">
      <td align="left" valign="top">
      </td>
      <td align="left" valign="top">
       <p>
        MySQL supports the Big5 character set which is common in Hong
        Kong and Taiwan (Republic of China). The MySQL
        <code class="literal">
         big5
        </code>
        character set is in reality Microsoft
        code page 950, which is very similar to the original
        <code class="literal">
         big5
        </code>
        character set.
       </p>
       <p>
        A feature request for adding
        <code class="literal">
         HKSCS
        </code>
        extensions
        has been filed. People who need this extension may find the
        suggested patch for Bug #13577 to be of interest.
       </p>
      </td>
     </tr>
     <tr class="question">
      <td align="left" valign="top">
       <a name="faq-cjk-what-japanese-chars-fail">
       </a>
       <a name="idm46045055470560">
       </a>
       <p>
        <b>
         A.11.4.
        </b>
       </p>
      </td>
      <td align="left" valign="top">
       <p>
        Why do Japanese character set conversions fail?
       </p>
      </td>
     </tr>
     <tr class="answer">
      <td align="left" valign="top">
      </td>
      <td align="left" valign="top">
       <p>
        MySQL supports the
        <code class="literal">
         sjis
        </code>
        ,
        <code class="literal">
         ujis
        </code>
        ,
        <code class="literal">
         cp932
        </code>
        , and
        <code class="literal">
         eucjpms
        </code>
        character sets, as well as Unicode. A
        common need is to convert between character sets. For example,
        there might be a Unix server (typically with
        <code class="literal">
         sjis
        </code>
        or
        <code class="literal">
         ujis
        </code>
        ) and a
        Windows client (typically with
        <code class="literal">
         cp932
        </code>
        ).
       </p>
       <p>
        In the following conversion table, the
        <code class="literal">
         ucs2
        </code>
        column represents the source, and the
        <code class="literal">
         sjis
        </code>
        ,
        <code class="literal">
         cp932
        </code>
        ,
        <code class="literal">
         ujis
        </code>
        , and
        <code class="literal">
         eucjpms
        </code>
        columns represent the destinations;
        that is, the last 4 columns provide the hexadecimal result when
        we use
        <a class="link" href="cast-functions.html#function_convert">
         <code class="literal">
          CONVERT(ucs2)
         </code>
        </a>
        or we assign
        a
        <code class="literal">
         ucs2
        </code>
        column containing the value to an
        <code class="literal">
         sjis
        </code>
        ,
        <code class="literal">
         cp932
        </code>
        ,
        <code class="literal">
         ujis
        </code>
        , or
        <code class="literal">
         eucjpms
        </code>
        column.
       </p>
       <div class="informaltable">
        <table summary="Result of assigning various ucs2 characters to a column that uses the sjis, cp932, ujis, or eucjpms character set.">
         <colgroup>
          <col style="width: 40%"/>
          <col align="left" style="width: 12%"/>
          <col align="right" style="width: 12%"/>
          <col align="right" style="width: 12%"/>
          <col align="right" style="width: 12%"/>
          <col align="right" style="width: 12%"/>
         </colgroup>
         <thead>
          <tr>
           <th scope="col">
            Character Name
           </th>
           <th scope="col">
            ucs2
           </th>
           <th scope="col">
            sjis
           </th>
           <th scope="col">
            cp932
           </th>
           <th scope="col">
            ujis
           </th>
           <th scope="col">
            eucjpms
           </th>
          </tr>
         </thead>
         <tbody>
          <tr>
           <th scope="row">
            BROKEN BAR
           </th>
           <td>
            00A6
           </td>
           <td>
            3F
           </td>
           <td>
            3F
           </td>
           <td>
            8FA2C3
           </td>
           <td>
            3F
           </td>
          </tr>
          <tr>
           <th scope="row">
            FULLWIDTH BROKEN BAR
           </th>
           <td>
            FFE4
           </td>
           <td>
            3F
           </td>
           <td>
            FA55
           </td>
           <td>
            3F
           </td>
           <td>
            8FA2
           </td>
          </tr>
          <tr>
           <th scope="row">
            YEN SIGN
           </th>
           <td>
            00A5
           </td>
           <td>
            3F
           </td>
           <td>
            3F
           </td>
           <td>
            20
           </td>
           <td>
            3F
           </td>
          </tr>
          <tr>
           <th scope="row">
            FULLWIDTH YEN SIGN
           </th>
           <td>
            FFE5
           </td>
           <td>
            818F
           </td>
           <td>
            818F
           </td>
           <td>
            A1EF
           </td>
           <td>
            3F
           </td>
          </tr>
          <tr>
           <th scope="row">
            TILDE
           </th>
           <td>
            007E
           </td>
           <td>
            7E
           </td>
           <td>
            7E
           </td>
           <td>
            7E
           </td>
           <td>
            7E
           </td>
          </tr>
          <tr>
           <th scope="row">
            OVERLINE
           </th>
           <td>
            203E
           </td>
           <td>
            3F
           </td>
           <td>
            3F
           </td>
           <td>
            20
           </td>
           <td>
            3F
           </td>
          </tr>
          <tr>
           <th scope="row">
            HORIZONTAL BAR
           </th>
           <td>
            2015
           </td>
           <td>
            815C
           </td>
           <td>
            815C
           </td>
           <td>
            A1BD
           </td>
           <td>
            A1BD
           </td>
          </tr>
          <tr>
           <th scope="row">
            EM DASH
           </th>
           <td>
            2014
           </td>
           <td>
            3F
           </td>
           <td>
            3F
           </td>
           <td>
            3F
           </td>
           <td>
            3F
           </td>
          </tr>
          <tr>
           <th scope="row">
            REVERSE SOLIDUS
           </th>
           <td>
            005C
           </td>
           <td>
            815F
           </td>
           <td>
            5C
           </td>
           <td>
            5C
           </td>
           <td>
            5C
           </td>
          </tr>
          <tr>
           <th scope="row">
            FULLWIDTH REVERSE SOLIDUS
           </th>
           <td>
            FF3C
           </td>
           <td>
            3F
           </td>
           <td>
            815F
           </td>
           <td>
            3F
           </td>
           <td>
            A1C0
           </td>
          </tr>
          <tr>
           <th scope="row">
            WAVE DASH
           </th>
           <td>
            301C
           </td>
           <td>
            8160
           </td>
           <td>
            3F
           </td>
           <td>
            A1C1
           </td>
           <td>
            3F
           </td>
          </tr>
          <tr>
           <th scope="row">
            FULLWIDTH TILDE
           </th>
           <td>
            FF5E
           </td>
           <td>
            3F
           </td>
           <td>
            8160
           </td>
           <td>
            3F
           </td>
           <td>
            A1C1
           </td>
          </tr>
          <tr>
           <th scope="row">
            DOUBLE VERTICAL LINE
           </th>
           <td>
            2016
           </td>
           <td>
            8161
           </td>
           <td>
            3F
           </td>
           <td>
            A1C2
           </td>
           <td>
            3F
           </td>
          </tr>
          <tr>
           <th scope="row">
            PARALLEL TO
           </th>
           <td>
            2225
           </td>
           <td>
            3F
           </td>
           <td>
            8161
           </td>
           <td>
            3F
           </td>
           <td>
            A1C2
           </td>
          </tr>
          <tr>
           <th scope="row">
            MINUS SIGN
           </th>
           <td>
            2212
           </td>
           <td>
            817C
           </td>
           <td>
            3F
           </td>
           <td>
            A1DD
           </td>
           <td>
            3F
           </td>
          </tr>
          <tr>
           <th scope="row">
            FULLWIDTH HYPHEN-MINUS
           </th>
           <td>
            FF0D
           </td>
           <td>
            3F
           </td>
           <td>
            817C
           </td>
           <td>
            3F
           </td>
           <td>
            A1DD
           </td>
          </tr>
          <tr>
           <th scope="row">
            CENT SIGN
           </th>
           <td>
            00A2
           </td>
           <td>
            8191
           </td>
           <td>
            3F
           </td>
           <td>
            A1F1
           </td>
           <td>
            3F
           </td>
          </tr>
          <tr>
           <th scope="row">
            FULLWIDTH CENT SIGN
           </th>
           <td>
            FFE0
           </td>
           <td>
            3F
           </td>
           <td>
            8191
           </td>
           <td>
            3F
           </td>
           <td>
            A1F1
           </td>
          </tr>
          <tr>
           <th scope="row">
            POUND SIGN
           </th>
           <td>
            00A3
           </td>
           <td>
            8192
           </td>
           <td>
            3F
           </td>
           <td>
            A1F2
           </td>
           <td>
            3F
           </td>
          </tr>
          <tr>
           <th scope="row">
            FULLWIDTH POUND SIGN
           </th>
           <td>
            FFE1
           </td>
           <td>
            3F
           </td>
           <td>
            8192
           </td>
           <td>
            3F
           </td>
           <td>
            A1F2
           </td>
          </tr>
          <tr>
           <th scope="row">
            NOT SIGN
           </th>
           <td>
            00AC
           </td>
           <td>
            81CA
           </td>
           <td>
            3F
           </td>
           <td>
            A2CC
           </td>
           <td>
            3F
           </td>
          </tr>
          <tr>
           <th scope="row">
            FULLWIDTH NOT SIGN
           </th>
           <td>
            FFE2
           </td>
           <td>
            3F
           </td>
           <td>
            81CA
           </td>
           <td>
            3F
           </td>
           <td>
            A2CC
           </td>
          </tr>
         </tbody>
        </table>
       </div>
       <div class="informaltable">
        <table cellpadding="0" cellspacing="0" style="position: fixed; top: 0px; display: none; left: 469.844px; width: 531px;">
         <thead>
          <tr>
           <th scope="col" style="width: 211.984px;">
            Character Name
           </th>
           <th scope="col" style="width: 63.5781px;">
            ucs2
           </th>
           <th scope="col" style="width: 63.5781px;">
            sjis
           </th>
           <th scope="col" style="width: 63.5781px;">
            cp932
           </th>
           <th scope="col" style="width: 63.5781px;">
            ujis
           </th>
           <th scope="col" style="width: 63.6406px;">
            eucjpms
           </th>
          </tr>
         </thead>
        </table>
       </div>
       <p>
        Now consider the following portion of the table.
       </p>
       <div class="informaltable">
        <table summary="Result of assigning NOT SIGN and FULLWIDTH NOT SIGN ucs2 characters to a column that uses the sjis, cp932, ujis, or eucjpms character set.">
         <colgroup>
          <col style="width: 55%"/>
          <col align="right" style="width: 15%"/>
          <col align="right" style="width: 15%"/>
          <col align="right" style="width: 15%"/>
         </colgroup>
         <thead>
          <tr>
           <th scope="col">
           </th>
           <th scope="col">
            ucs2
           </th>
           <th scope="col">
            sjis
           </th>
           <th scope="col">
            cp932
           </th>
          </tr>
         </thead>
         <tbody>
          <tr>
           <th scope="row">
            NOT SIGN
           </th>
           <td>
            00AC
           </td>
           <td>
            81CA
           </td>
           <td>
            3F
           </td>
          </tr>
          <tr>
           <th scope="row">
            FULLWIDTH NOT SIGN
           </th>
           <td>
            FFE2
           </td>
           <td>
            3F
           </td>
           <td>
            81CA
           </td>
          </tr>
         </tbody>
        </table>
       </div>
       <p>
        This means that MySQL converts the
        <code class="literal">
         NOT SIGN
        </code>
        (Unicode
        <code class="literal">
         U+00AC
        </code>
        ) to
        <code class="literal">
         sjis
        </code>
        code point
        <code class="literal">
         0x81CA
        </code>
        and to
        <code class="literal">
         cp932
        </code>
        code point
        <code class="literal">
         3F
        </code>
        .
        (
        <code class="literal">
         3F
        </code>
        is the question mark (
        <span class="quote">
         “
         <span class="quote">
          ?
         </span>
         ”
        </span>
        .
        This is what is always used when the conversion cannot be
        performed.)
       </p>
      </td>
     </tr>
     <tr class="question">
      <td align="left" valign="top">
       <a name="faq-cjk-how-convert-81ca-cp932">
       </a>
       <a name="idm46045055284352">
       </a>
       <p>
        <b>
         A.11.5.
        </b>
       </p>
      </td>
      <td align="left" valign="top">
       <p>
        What should I do if I want to convert SJIS
        <code class="literal">
         81CA
        </code>
        to
        <code class="literal">
         cp932
        </code>
        ?
       </p>
      </td>
     </tr>
     <tr class="answer">
      <td align="left" valign="top">
      </td>
      <td align="left" valign="top">
       <p>
        Our answer is:
        <span class="quote">
         “
         <span class="quote">
          ?
         </span>
         ”
        </span>
        . There are disadvantages to
        this, and many people would prefer a
        <span class="quote">
         “
         <span class="quote">
          loose
         </span>
         ”
        </span>
        conversion, so that
        <code class="literal">
         81CA (NOT SIGN)
        </code>
        in
        <code class="literal">
         sjis
        </code>
        becomes
        <code class="literal">
         81CA (FULLWIDTH NOT
        SIGN)
        </code>
        in
        <code class="literal">
         cp932
        </code>
        .
       </p>
      </td>
     </tr>
     <tr class="question">
      <td align="left" valign="top">
       <a name="faq-cjk-how-represent-yen">
       </a>
       <a name="idm46045055277024">
       </a>
       <p>
        <b>
         A.11.6.
        </b>
       </p>
      </td>
      <td align="left" valign="top">
       <p>
        How does MySQL represent the Yen (
        <code class="literal">
         ¥
        </code>
        ) sign?
       </p>
      </td>
     </tr>
     <tr class="answer">
      <td align="left" valign="top">
      </td>
      <td align="left" valign="top">
       <p>
        A problem arises because some versions of Japanese character
        sets (both
        <code class="literal">
         sjis
        </code>
        and
        <code class="literal">
         euc
        </code>
        )
        treat
        <code class="literal">
         5C
        </code>
        as a
        <span class="firstterm">
         reverse solidus
        </span>
        (
        <code class="literal">
         \
        </code>
        , also known as a backslash), whereas
        others treat it as a yen sign (
        <code class="literal">
         ¥
        </code>
        ).
       </p>
       <p>
        MySQL follows only one version of the JIS (Japanese Industrial
        Standards) standard description. In MySQL,
        <span class="emphasis">
         <em>
          <code class="literal">
           5C
          </code>
          is always the reverse solidus
        (
          <code class="literal">
           \
          </code>
          )
         </em>
        </span>
        .
       </p>
      </td>
     </tr>
     <tr class="question">
      <td align="left" valign="top">
       <a name="faq-cjk-what-problems-korean">
       </a>
       <a name="idm46045055267744">
       </a>
       <p>
        <b>
         A.11.7.
        </b>
       </p>
      </td>
      <td align="left" valign="top">
       <p>
        Of what issues should I be aware when working with Korean
        character sets in MySQL?
       </p>
      </td>
     </tr>
     <tr class="answer">
      <td align="left" valign="top">
      </td>
      <td align="left" valign="top">
       <p>
        In theory, while there have been several versions of the
        <code class="literal">
         euckr
        </code>
        (
        <span class="firstterm">
         Extended
        Unix Code Korea
        </span>
        ) character set, only one problem has
        been noted. We use the
        <span class="quote">
         “
         <span class="quote">
          ASCII
         </span>
         ”
        </span>
        variant of EUC-KR,
        in which the code point
        <code class="literal">
         0x5c
        </code>
        is REVERSE
        SOLIDUS, that is
        <code class="literal">
         \
        </code>
        , instead of the
        <span class="quote">
         “
         <span class="quote">
          KS-Roman
         </span>
         ”
        </span>
        variant of EUC-KR, in which the code
        point
        <code class="literal">
         0x5c
        </code>
        is
        <code class="literal">
         WON SIGN
        </code>
        (
        <code class="literal">
         ₩
        </code>
        ). This means that you cannot convert
        Unicode
        <code class="literal">
         U+20A9
        </code>
        to
        <code class="literal">
         euckr
        </code>
        :
       </p>
       <div class="copytoclipboard-wrapper">
        <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa90649276"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">SELECT</span>
           <span class="token function">CONVERT</span><span class="token punctuation">(</span><span class="token string">'₩'</span> <span class="token keyword">USING</span> euckr<span class="token punctuation">)</span> <span class="token keyword">AS</span> euckr<span class="token punctuation">,</span>
           <span class="token function">HEX</span><span class="token punctuation">(</span><span class="token function">CONVERT</span><span class="token punctuation">(</span><span class="token string">'₩'</span> <span class="token keyword">USING</span> euckr<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> hexeuckr<span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> euckr <span class="token punctuation">|</span> hexeuckr <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> ?     <span class="token punctuation">|</span> 3F       <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span></code></pre>
       </div>
      </td>
     </tr>
     <tr class="question">
      <td align="left" valign="top">
       <a name="faq-cjk-why-incorrect-string-value">
       </a>
       <a name="idm46045055254896">
       </a>
       <p>
        <b>
         A.11.8.
        </b>
       </p>
      </td>
      <td align="left" valign="top">
       <p>
        Why do I get
        <span class="errortext">
         Incorrect string value
        </span>
        error
        messages?
       </p>
      </td>
     </tr>
     <tr class="answer">
      <td align="left" valign="top">
      </td>
      <td align="left" valign="top">
       <p>
        To see the problem, create a table with one Unicode
        (
        <code class="literal">
         ucs2
        </code>
        ) column and one Chinese
        (
        <code class="literal">
         gb2312
        </code>
        ) column.
       </p>
       <div class="copytoclipboard-wrapper">
        <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa44062214"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> ch
       <span class="token punctuation">(</span>ucs2 <span class="token datatype">CHAR</span><span class="token punctuation">(</span><span class="token number">3</span><span class="token punctuation">)</span> <span class="token keyword">CHARACTER</span> <span class="token keyword">SET</span> ucs2<span class="token punctuation">,</span>
       gb2312 <span class="token datatype">CHAR</span><span class="token punctuation">(</span><span class="token number">3</span><span class="token punctuation">)</span> <span class="token keyword">CHARACTER</span> <span class="token keyword">SET</span> gb2312<span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
       </div>
       <p>
        In nonstrict SQL mode, try to place the rare character
        <code class="literal">
         汌
        </code>
        in both columns.
       </p>
       <div class="copytoclipboard-wrapper">
        <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa56073488"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">SET</span> sql_mode <span class="token operator">=</span> <span class="token string">''</span><span class="token punctuation">;</span>
<span class="token prompt">mysql&gt;</span> <span class="token keyword">INSERT</span> <span class="token keyword">INTO</span> ch <span class="token keyword">VALUES</span> <span class="token punctuation">(</span><span class="token string">'A汌B'</span><span class="token punctuation">,</span><span class="token string">'A汌B'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token output">Query OK, 1 row affected, 1 warning (0.00 sec)</span></code></pre>
       </div>
       <p>
        The
        <a class="link" href="insert.html" title="15.2.7 INSERT Statement">
         <code class="literal">
          INSERT
         </code>
        </a>
        produces a warning.
        Use the following statement to see what it is:
       </p>
       <div class="copytoclipboard-wrapper">
        <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa50035722"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">SHOW</span> <span class="token keyword">WARNINGS</span>\G
<span class="token output"><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span> 1. row <span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span><span class="token punctuation">*</span>
  Level<span class="token punctuation">:</span> Warning
   Code<span class="token punctuation">:</span> 1366
Message<span class="token punctuation">:</span> Incorrect string value<span class="token punctuation">:</span> '\xE6\xB1\x8CB' for column 'gb2312' at row 1</span></code></pre>
       </div>
       <p>
        So it is a warning about the
        <code class="literal">
         gb2312
        </code>
        column
        only.
       </p>
       <div class="copytoclipboard-wrapper">
        <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa46371347"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">SELECT</span> ucs2<span class="token punctuation">,</span><span class="token function">HEX</span><span class="token punctuation">(</span>ucs2<span class="token punctuation">)</span><span class="token punctuation">,</span>gb2312<span class="token punctuation">,</span><span class="token function">HEX</span><span class="token punctuation">(</span>gb2312<span class="token punctuation">)</span> <span class="token keyword">FROM</span> ch<span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> ucs2  <span class="token punctuation">|</span> HEX(ucs2)    <span class="token punctuation">|</span> gb2312 <span class="token punctuation">|</span> HEX(gb2312) <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> A汌B <span class="token punctuation">|</span> 00416C4C0042 <span class="token punctuation">|</span> A?B    <span class="token punctuation">|</span> 413F42      <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span></code></pre>
       </div>
       <p>
        Several things need explanation here:
       </p>
       <div class="orderedlist">
        <ol class="orderedlist" type="1">
         <li class="listitem">
          <p>
           The
           <code class="literal">
            汌
           </code>
           character is not in the
           <code class="literal">
            gb2312
           </code>
           character set, as described
            earlier.
          </p>
         </li>
         <li class="listitem">
          <p>
           If you are using an old version of MySQL, you may see a
            different message.
          </p>
         </li>
         <li class="listitem">
          <p>
           A warning occurs rather than an error because MySQL is not
            set to use strict SQL mode. In nonstrict mode, MySQL tries
            to do what it can, to get the best fit, rather than give up.
            With strict SQL mode, the
           <span class="errortext">
            Incorrect string
            value
           </span>
           message occurs as an error rather than a
            warning, and the
           <a class="link" href="insert.html" title="15.2.7 INSERT Statement">
            <code class="literal">
             INSERT
            </code>
           </a>
           fails.
          </p>
         </li>
        </ol>
       </div>
      </td>
     </tr>
     <tr class="question">
      <td align="left" valign="top">
       <a name="faq-cjk-why-gui-not-display-cjk">
       </a>
       <a name="idm46045055230912">
       </a>
       <p>
        <b>
         A.11.9.
        </b>
       </p>
      </td>
      <td align="left" valign="top">
       <p>
        Why does my GUI front end or browser display CJK characters
        incorrectly in my application using Access, PHP, or another API?
       </p>
      </td>
     </tr>
     <tr class="answer">
      <td align="left" valign="top">
      </td>
      <td align="left" valign="top">
       <p>
        Obtain a direct connection to the server using the
        <a class="link" href="mysql.html" title="6.5.1 mysql — The MySQL Command-Line Client">
         <span class="command">
          <strong>
           mysql
          </strong>
         </span>
        </a>
        client, and try the same query there.
        If
        <a class="link" href="mysql.html" title="6.5.1 mysql — The MySQL Command-Line Client">
         <span class="command">
          <strong>
           mysql
          </strong>
         </span>
        </a>
        responds correctly, the trouble may
        be that your application interface requires initialization. Use
        <a class="link" href="mysql.html" title="6.5.1 mysql — The MySQL Command-Line Client">
         <span class="command">
          <strong>
           mysql
          </strong>
         </span>
        </a>
        to tell you what character set or sets
        it uses with the statement
        <code class="literal">
         SHOW VARIABLES LIKE
        'char%';
        </code>
        . If you are using Access, you are most likely
        connecting with Connector/ODBC. In this case, you should check
        <a class="ulink" href="/doc/connector-odbc/en/connector-odbc-configuration.html" target="_top">
         Configuring Connector/ODBC
        </a>
        . If, for example,
        you use
        <code class="literal">
         big5
        </code>
        , you would enter
        <code class="literal">
         SET
        NAMES 'big5'
        </code>
        . (In this case, no
        <code class="literal">
         ;
        </code>
        character is required.) If you are using ASP, you might need to
        add
        <a class="link" href="set-names.html" title="15.7.6.3 SET NAMES Statement">
         <code class="literal">
          SET NAMES
         </code>
        </a>
        in the code. Here
        is an example that has worked in the past:
       </p>
       <div class="copytoclipboard-wrapper">
        <pre class="programlisting language-none"><div class="docs-select-all right" id="sa52889031"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-none">&lt;%
Session.CodePage=0
Dim strConnection
Dim Conn
strConnection="driver={MySQL ODBC 3.51 Driver};server=<em class="replaceable">server</em>;uid=<em class="replaceable">username</em>;" \
               &amp; "pwd=<em class="replaceable">password</em>;database=<em class="replaceable">database</em>;stmt=SET NAMES 'big5';"
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open strConnection
%&gt;</code></pre>
       </div>
       <p>
        In much the same way, if you are using any character set other
        than
        <code class="literal">
         latin1
        </code>
        with Connector/NET, you must specify the
        character set in the connection string. See
        <a class="ulink" href="/doc/connector-net/en/connector-net-connections.html" target="_top">
         Connector/NET Connections
        </a>
        , for more
        information.
       </p>
       <p>
        If you are using PHP, try this:
       </p>
       <div class="copytoclipboard-wrapper">
        <pre class="programlisting language-php"><div class="docs-select-all right" id="sa3283930"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-php"><span class="token php language-php"><span class="token delimiter important">&lt;?php</span>
  <span class="token variable">$link</span> <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">mysqli</span><span class="token punctuation">(</span><span class="token variable">$host</span><span class="token punctuation">,</span> <span class="token variable">$usr</span><span class="token punctuation">,</span> <span class="token variable">$pwd</span><span class="token punctuation">,</span> <span class="token variable">$db</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

  <span class="token keyword">if</span><span class="token punctuation">(</span> <span class="token function">mysqli_connect_errno</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">)</span>
  <span class="token punctuation">{</span>
    <span class="token function">printf</span><span class="token punctuation">(</span><span class="token string">"Connect failed: %s\n"</span><span class="token punctuation">,</span> <span class="token function">mysqli_connect_error</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token function">exit</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
  <span class="token punctuation">}</span>

  <span class="token variable">$link</span><span class="token operator">-</span><span class="token operator">&gt;</span><span class="token function">query</span><span class="token punctuation">(</span><span class="token string">"SET NAMES 'utf8'"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token delimiter important">?&gt;</span></span></code></pre>
       </div>
       <p>
        In this case, we used
        <a class="link" href="set-names.html" title="15.7.6.3 SET NAMES Statement">
         <code class="literal">
          SET NAMES
         </code>
        </a>
        to change
        <a class="link" href="server-system-variables.html#sysvar_character_set_client">
         <code class="literal">
          character_set_client
         </code>
        </a>
        ,
        <a class="link" href="server-system-variables.html#sysvar_character_set_connection">
         <code class="literal">
          character_set_connection
         </code>
        </a>
        , and
        <a class="link" href="server-system-variables.html#sysvar_character_set_results">
         <code class="literal">
          character_set_results
         </code>
        </a>
        .
       </p>
       <p>
        Another issue often encountered in PHP applications has to do
        with assumptions made by the browser. Sometimes adding or
        changing a
        <code class="literal">
         &lt;meta&gt;
        </code>
        tag suffices to
        correct the problem: for example, to insure that the user agent
        interprets page content as
        <code class="literal">
         UTF-8
        </code>
        , include
        <code class="literal">
         &lt;meta http-equiv="Content-Type" content="text/html;
        charset=utf-8"&gt;
        </code>
        in the
        <code class="literal">
         &lt;head&gt;
        </code>
        section of the HTML page.
       </p>
       <p>
        If you are using Connector/J, see
        <a class="ulink" href="/doc/connector-j/en/connector-j-reference-charsets.html" target="_top">
         Using Character Sets and Unicode
        </a>
        .
       </p>
      </td>
     </tr>
     <tr class="question">
      <td align="left" valign="top">
       <a name="faq-cjk-how-use-4-0-charset">
       </a>
       <a name="idm46045055202304">
       </a>
       <p>
        <b>
         A.11.10.
        </b>
       </p>
      </td>
      <td align="left" valign="top">
       <p>
        I've upgraded to MySQL 8.4. How can I revert to
        behavior like that in MySQL 4.0 with regard to character sets?
       </p>
      </td>
     </tr>
     <tr class="answer">
      <td align="left" valign="top">
      </td>
      <td align="left" valign="top">
       <p>
        In MySQL Version 4.0, there was a single
        <span class="quote">
         “
         <span class="quote">
          global
         </span>
         ”
        </span>
        character set for both server and client, and the decision as to
        which character to use was made by the server administrator.
        This changed starting with MySQL Version 4.1. What happens now
        is a
        <span class="quote">
         “
         <span class="quote">
          handshake
         </span>
         ”
        </span>
        , as described in
        <a class="xref" href="charset-connection.html" title="12.4 Connection Character Sets and Collations">
         Section 12.4, “Connection Character Sets and Collations”
        </a>
        :
       </p>
       <div class="blockquote">
        <blockquote class="blockquote">
         <p>
          When a client connects, it sends to the server the name of the
          character set that it wants to use. The server uses the name
          to set the
          <a class="link" href="server-system-variables.html#sysvar_character_set_client">
           <code class="literal">
            character_set_client
           </code>
          </a>
          ,
          <a class="link" href="server-system-variables.html#sysvar_character_set_results">
           <code class="literal">
            character_set_results
           </code>
          </a>
          , and
          <a class="link" href="server-system-variables.html#sysvar_character_set_connection">
           <code class="literal">
            character_set_connection
           </code>
          </a>
          system variables. In effect, the server performs a
          <a class="link" href="set-names.html" title="15.7.6.3 SET NAMES Statement">
           <code class="literal">
            SET NAMES
           </code>
          </a>
          operation using the
          character set name.
         </p>
        </blockquote>
       </div>
       <p>
        The effect of this is that you cannot control the client
        character set by starting
        <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
         <span class="command">
          <strong>
           mysqld
          </strong>
         </span>
        </a>
        with
        <a class="link" href="server-system-variables.html#sysvar_character_set_server">
         <code class="option">
          --character-set-server=utf8
         </code>
        </a>
        .
        However, some Asian customers prefer the MySQL 4.0 behavior. To
        make it possible to retain this behavior, we added a
        <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
         <span class="command">
          <strong>
           mysqld
          </strong>
         </span>
        </a>
        switch,
        <a class="ulink" href="/doc/refman/8.0/en/server-options.html#option_mysqld_character-set-client-handshake" target="_top">
         <code class="option">
          --character-set-client-handshake
         </code>
        </a>
        ,
        which can be turned off with
        <a class="ulink" href="/doc/refman/8.0/en/server-options.html#option_mysqld_character-set-client-handshake" target="_top">
         <code class="option">
          --skip-character-set-client-handshake
         </code>
        </a>
        .
        If you start
        <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
         <span class="command">
          <strong>
           mysqld
          </strong>
         </span>
        </a>
        with
        <a class="ulink" href="/doc/refman/8.0/en/server-options.html#option_mysqld_character-set-client-handshake" target="_top">
         <code class="option">
          --skip-character-set-client-handshake
         </code>
        </a>
        ,
        then, when a client connects, it sends to the server the name of
        the character set that it wants to use. However,
        <span class="emphasis">
         <em>
          the
        server ignores this request from the client
         </em>
        </span>
        .
       </p>
       <p>
        By way of example, suppose that your favorite server character
        set is
        <code class="literal">
         latin1
        </code>
        . Suppose further that the
        client uses
        <code class="literal">
         utf8
        </code>
        because this is what the
        client's operating system supports. Start the server with
        <code class="literal">
         latin1
        </code>
        as its default character set:
       </p>
       <div class="copytoclipboard-wrapper">
        <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa44294501"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal">mysqld <span class="token constant">--character-set-server</span><span class="token attr-value"><span class="token punctuation">=</span>latin1</span></code></pre>
       </div>
       <p>
        And then start the client with the default character set
        <code class="literal">
         utf8
        </code>
        :
       </p>
       <div class="copytoclipboard-wrapper">
        <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa86905237"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal">mysql <span class="token constant">--default-character-set</span><span class="token attr-value"><span class="token punctuation">=</span>utf8</span></code></pre>
       </div>
       <p>
        The resulting settings can be seen by viewing the output of
        <a class="link" href="show-variables.html" title="15.7.7.41 SHOW VARIABLES Statement">
         <code class="literal">
          SHOW VARIABLES
         </code>
        </a>
        :
       </p>
       <div class="copytoclipboard-wrapper">
        <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa34381330"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">SHOW</span> <span class="token keyword">VARIABLES</span> <span class="token operator">LIKE</span> <span class="token string">'char%'</span><span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> Variable_name            <span class="token punctuation">|</span> Value                                  <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> character_set_client     <span class="token punctuation">|</span> utf8                                   <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> character_set_connection <span class="token punctuation">|</span> utf8                                   <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> character_set_database   <span class="token punctuation">|</span> latin1                                 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> character_set_filesystem <span class="token punctuation">|</span> binary                                 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> character_set_results    <span class="token punctuation">|</span> utf8                                   <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> character_set_server     <span class="token punctuation">|</span> latin1                                 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> character_set_system     <span class="token punctuation">|</span> utf8                                   <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> character_sets_dir       <span class="token punctuation">|</span> /usr/local/mysql/share/mysql/charsets/ <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span></code></pre>
       </div>
       <p>
        Now stop the client, and stop the server using
        <a class="link" href="mysqladmin.html" title="6.5.2 mysqladmin — A MySQL Server Administration Program">
         <span class="command">
          <strong>
           mysqladmin
          </strong>
         </span>
        </a>
        . Then start the server again, but
        this time tell it to skip the handshake like so:
       </p>
       <div class="copytoclipboard-wrapper">
        <pre class="programlisting one-line language-terminal"><div class="docs-select-all right" id="sa74061767"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-terminal">mysqld <span class="token constant">--character-set-server</span><span class="token attr-value"><span class="token punctuation">=</span>utf8</span> <span class="token property">--skip-character-set-client-handshake</span></code></pre>
       </div>
       <p>
        Start the client with
        <code class="literal">
         utf8
        </code>
        once again as the
        default character set, then display the resulting settings:
       </p>
       <div class="copytoclipboard-wrapper">
        <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa20577870"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">SHOW</span> <span class="token keyword">VARIABLES</span> <span class="token operator">LIKE</span> <span class="token string">'char%'</span><span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> Variable_name            <span class="token punctuation">|</span> Value                                  <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> character_set_client     <span class="token punctuation">|</span> latin1                                 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> character_set_connection <span class="token punctuation">|</span> latin1                                 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> character_set_database   <span class="token punctuation">|</span> latin1                                 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> character_set_filesystem <span class="token punctuation">|</span> binary                                 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> character_set_results    <span class="token punctuation">|</span> latin1                                 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> character_set_server     <span class="token punctuation">|</span> latin1                                 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> character_set_system     <span class="token punctuation">|</span> utf8                                   <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> character_sets_dir       <span class="token punctuation">|</span> /usr/local/mysql/share/mysql/charsets/ <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span></code></pre>
       </div>
       <p>
        As you can see by comparing the differing results from
        <a class="link" href="show-variables.html" title="15.7.7.41 SHOW VARIABLES Statement">
         <code class="literal">
          SHOW VARIABLES
         </code>
        </a>
        , the server
        ignores the client's initial settings if the
        <a class="ulink" href="/doc/refman/8.0/en/server-options.html#option_mysqld_character-set-client-handshake" target="_top">
         <code class="option">
          --skip-character-set-client-handshake
         </code>
        </a>
        option is used.
       </p>
      </td>
     </tr>
     <tr class="question">
      <td align="left" valign="top">
       <a name="faq-cjk-why-cjk-fail-searches">
       </a>
       <a name="idm46045055164096">
       </a>
       <p>
        <b>
         A.11.11.
        </b>
       </p>
      </td>
      <td align="left" valign="top">
       <p>
        Why do some
        <a class="link" href="string-comparison-functions.html#operator_like">
         <code class="literal">
          LIKE
         </code>
        </a>
        and
        <code class="literal">
         FULLTEXT
        </code>
        searches with CJK characters fail?
       </p>
      </td>
     </tr>
     <tr class="answer">
      <td align="left" valign="top">
      </td>
      <td align="left" valign="top">
       <p>
        For
        <a class="link" href="string-comparison-functions.html#operator_like">
         <code class="literal">
          LIKE
         </code>
        </a>
        searches, there is a very
        simple problem with binary string column types such as
        <a class="link" href="binary-varbinary.html" title="13.3.3 The BINARY and VARBINARY Types">
         <code class="literal">
          BINARY
         </code>
        </a>
        and
        <a class="link" href="blob.html" title="13.3.4 The BLOB and TEXT Types">
         <code class="literal">
          BLOB
         </code>
        </a>
        : we must know where
        characters end. With multibyte character sets, different
        characters might have different octet lengths. For example, in
        <code class="literal">
         utf8
        </code>
        ,
        <code class="literal">
         A
        </code>
        requires one byte
        but
        <code class="literal">
         ペ
        </code>
        requires three bytes, as shown here:
       </p>
       <div class="copytoclipboard-wrapper">
        <pre class="programlisting language-none"><div class="docs-select-all right" id="sa48412239"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-none">+-------------------------+---------------------------+
| OCTET_LENGTH(_utf8 'A') | OCTET_LENGTH(_utf8 'ペ') |
+-------------------------+---------------------------+
|                       1 |                         3 |
+-------------------------+---------------------------+</code></pre>
       </div>
       <p>
        If we do not know where the first character in a string ends, we
        do not know where the second character begins, in which case
        even very simple searches such as
        <a class="link" href="string-comparison-functions.html#operator_like">
         <code class="literal">
          LIKE '_A%'
         </code>
        </a>
        fail.
        The solution is to use a nonbinary string column type defined to
        have the proper CJK character set. For example:
        <code class="literal">
         mycol
        TEXT CHARACTER SET sjis
        </code>
        . Alternatively, convert to a
        CJK character set before comparing.
       </p>
       <p>
        This is one reason why MySQL cannot permit encodings of
        nonexistent characters. If it is not strict about rejecting bad
        input, it has no way of knowing where characters end.
       </p>
       <p>
        For
        <code class="literal">
         FULLTEXT
        </code>
        searches, we must know where
        words begin and end. With Western languages, this is rarely a
        problem because most (if not all) of these use an
        easy-to-identify word boundary: the space character. However,
        this is not usually the case with Asian writing. We could use
        arbitrary halfway measures, like assuming that all Han
        characters represent words, or (for Japanese) depending on
        changes from Katakana to Hiragana due to grammatical endings.
        However, the only sure solution requires a comprehensive word
        list, which means that we would have to include a dictionary in
        the server for each Asian language supported. This is simply not
        feasible.
       </p>
      </td>
     </tr>
     <tr class="question">
      <td align="left" valign="top">
       <a name="faq-cjk-how-know-avail-characters">
       </a>
       <a name="idm46045055147408">
       </a>
       <p>
        <b>
         A.11.12.
        </b>
       </p>
      </td>
      <td align="left" valign="top">
       <p>
        How do I know whether character
        <em class="replaceable">
         <code>
          X
         </code>
        </em>
        is
        available in all character sets?
       </p>
      </td>
     </tr>
     <tr class="answer">
      <td align="left" valign="top">
      </td>
      <td align="left" valign="top">
       <p>
        The majority of simplified Chinese and basic nonhalfwidth
        Japanese Kana characters appear in all CJK character sets. The
        following stored procedure accepts a
        <code class="literal">
         UCS-2
        </code>
        Unicode character, converts it to other character sets, and
        displays the results in hexadecimal.
       </p>
       <div class="copytoclipboard-wrapper">
        <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa61678015"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">DELIMITER</span> <span class="token comment" spellcheck="true">//</span>

<span class="token keyword">CREATE</span> <span class="token keyword">PROCEDURE</span> p_convert<span class="token punctuation">(</span>ucs2_char <span class="token datatype">CHAR</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span> <span class="token keyword">CHARACTER</span> <span class="token keyword">SET</span> ucs2<span class="token punctuation">)</span>
<span class="token keyword">BEGIN</span>

<span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> tj
             <span class="token punctuation">(</span>ucs2 <span class="token datatype">CHAR</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span> <span class="token keyword">character</span> <span class="token keyword">set</span> ucs2<span class="token punctuation">,</span>
              utf8 <span class="token datatype">CHAR</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span> <span class="token keyword">character</span> <span class="token keyword">set</span> utf8<span class="token punctuation">,</span>
              big5 <span class="token datatype">CHAR</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span> <span class="token keyword">character</span> <span class="token keyword">set</span> big5<span class="token punctuation">,</span>
              cp932 <span class="token datatype">CHAR</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span> <span class="token keyword">character</span> <span class="token keyword">set</span> cp932<span class="token punctuation">,</span>
              eucjpms <span class="token datatype">CHAR</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span> <span class="token keyword">character</span> <span class="token keyword">set</span> eucjpms<span class="token punctuation">,</span>
              euckr <span class="token datatype">CHAR</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span> <span class="token keyword">character</span> <span class="token keyword">set</span> euckr<span class="token punctuation">,</span>
              gb2312 <span class="token datatype">CHAR</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span> <span class="token keyword">character</span> <span class="token keyword">set</span> gb2312<span class="token punctuation">,</span>
              gbk <span class="token datatype">CHAR</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span> <span class="token keyword">character</span> <span class="token keyword">set</span> gbk<span class="token punctuation">,</span>
              sjis <span class="token datatype">CHAR</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span> <span class="token keyword">character</span> <span class="token keyword">set</span> sjis<span class="token punctuation">,</span>
              ujis <span class="token datatype">CHAR</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">)</span> <span class="token keyword">character</span> <span class="token keyword">set</span> ujis<span class="token punctuation">)</span><span class="token punctuation">;</span>

<span class="token keyword">INSERT</span> <span class="token keyword">INTO</span> tj <span class="token punctuation">(</span>ucs2<span class="token punctuation">)</span> <span class="token keyword">VALUES</span> <span class="token punctuation">(</span>ucs2_char<span class="token punctuation">)</span><span class="token punctuation">;</span>

<span class="token keyword">UPDATE</span> tj <span class="token keyword">SET</span> utf8<span class="token operator">=</span>ucs2<span class="token punctuation">,</span>
              big5<span class="token operator">=</span>ucs2<span class="token punctuation">,</span>
              cp932<span class="token operator">=</span>ucs2<span class="token punctuation">,</span>
              eucjpms<span class="token operator">=</span>ucs2<span class="token punctuation">,</span>
              euckr<span class="token operator">=</span>ucs2<span class="token punctuation">,</span>
              gb2312<span class="token operator">=</span>ucs2<span class="token punctuation">,</span>
              gbk<span class="token operator">=</span>ucs2<span class="token punctuation">,</span>
              sjis<span class="token operator">=</span>ucs2<span class="token punctuation">,</span>
              ujis<span class="token operator">=</span>ucs2<span class="token punctuation">;</span>

<span class="token comment" spellcheck="true">/* If there are conversion problems, UPDATE produces warnings. */</span>

<span class="token keyword">SELECT</span> <span class="token function">hex</span><span class="token punctuation">(</span>ucs2<span class="token punctuation">)</span> <span class="token keyword">AS</span> ucs2<span class="token punctuation">,</span>
       <span class="token function">hex</span><span class="token punctuation">(</span>utf8<span class="token punctuation">)</span> <span class="token keyword">AS</span> utf8<span class="token punctuation">,</span>
       <span class="token function">hex</span><span class="token punctuation">(</span>big5<span class="token punctuation">)</span> <span class="token keyword">AS</span> big5<span class="token punctuation">,</span>
       <span class="token function">hex</span><span class="token punctuation">(</span>cp932<span class="token punctuation">)</span> <span class="token keyword">AS</span> cp932<span class="token punctuation">,</span>
       <span class="token function">hex</span><span class="token punctuation">(</span>eucjpms<span class="token punctuation">)</span> <span class="token keyword">AS</span> eucjpms<span class="token punctuation">,</span>
       <span class="token function">hex</span><span class="token punctuation">(</span>euckr<span class="token punctuation">)</span> <span class="token keyword">AS</span> euckr<span class="token punctuation">,</span>
       <span class="token function">hex</span><span class="token punctuation">(</span>gb2312<span class="token punctuation">)</span> <span class="token keyword">AS</span> gb2312<span class="token punctuation">,</span>
       <span class="token function">hex</span><span class="token punctuation">(</span>gbk<span class="token punctuation">)</span> <span class="token keyword">AS</span> gbk<span class="token punctuation">,</span>
       <span class="token function">hex</span><span class="token punctuation">(</span>sjis<span class="token punctuation">)</span> <span class="token keyword">AS</span> sjis<span class="token punctuation">,</span>
       <span class="token function">hex</span><span class="token punctuation">(</span>ujis<span class="token punctuation">)</span> <span class="token keyword">AS</span> ujis
<span class="token keyword">FROM</span> tj<span class="token punctuation">;</span>

<span class="token keyword">DROP</span> <span class="token keyword">TABLE</span> tj<span class="token punctuation">;</span>

<span class="token keyword">END</span><span class="token comment" spellcheck="true">//</span>

<span class="token keyword">DELIMITER</span> <span class="token punctuation">;</span></code></pre>
       </div>
       <p>
        The input can be any single
        <code class="literal">
         ucs2
        </code>
        character,
        or it can be the code value (hexadecimal representation) of that
        character. For example, from Unicode's list of
        <code class="literal">
         ucs2
        </code>
        encodings and names
        (
        <a class="ulink" href="http://www.unicode.org/Public/UNIDATA/UnicodeData.txt" target="_blank">
         http://www.unicode.org/Public/UNIDATA/UnicodeData.txt
        </a>
        ),
        we know that the Katakana character
        <span class="foreignphrase">
         <em class="foreignphrase">
          Pe
         </em>
        </span>
        appears in all CJK character
        sets, and that its code value is
        <code class="literal">
         X'30DA'
        </code>
        . If
        we use this value as the argument to
        <code class="literal">
         p_convert()
        </code>
        , the result is as shown here:
       </p>
       <div class="copytoclipboard-wrapper">
        <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa89462459"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">CALL</span> p_convert<span class="token punctuation">(</span>X<span class="token string">'30DA'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> ucs2 <span class="token punctuation">|</span> utf8   <span class="token punctuation">|</span> big5 <span class="token punctuation">|</span> cp932 <span class="token punctuation">|</span> eucjpms <span class="token punctuation">|</span> euckr <span class="token punctuation">|</span> gb2312 <span class="token punctuation">|</span> gbk  <span class="token punctuation">|</span> sjis <span class="token punctuation">|</span> ujis <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> 30DA <span class="token punctuation">|</span> E3839A <span class="token punctuation">|</span> C772 <span class="token punctuation">|</span> 8379  <span class="token punctuation">|</span> A5DA    <span class="token punctuation">|</span> ABDA  <span class="token punctuation">|</span> A5DA   <span class="token punctuation">|</span> A5DA <span class="token punctuation">|</span> 8379 <span class="token punctuation">|</span> A5DA <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span></code></pre>
       </div>
       <p>
        Since none of the column values is
        <code class="literal">
         3F
        </code>
        (that
        is, the question mark character,
        <code class="literal">
         ?
        </code>
        ), we know
        that every conversion worked.
       </p>
      </td>
     </tr>
     <tr class="question">
      <td align="left" valign="top">
       <a name="faq-cjk-how-cjk-sort-unicode-1">
       </a>
       <a name="idm46045055132896">
       </a>
       <p>
        <b>
         A.11.13.
        </b>
       </p>
      </td>
      <td align="left" valign="top">
       <p>
        Why do CJK strings sort incorrectly in Unicode? (I)
       </p>
      </td>
     </tr>
     <tr class="answer">
      <td align="left" valign="top">
      </td>
      <td align="left" valign="top">
       <p>
        CJK sorting problems that occurred in older MySQL versions can
        be solved as of MySQL 8.0 by using the
        <code class="literal">
         utf8mb4
        </code>
        character set and the
        <code class="literal">
         utf8mb4_ja_0900_as_cs
        </code>
        collation.
       </p>
      </td>
     </tr>
     <tr class="question">
      <td align="left" valign="top">
       <a name="faq-cjk-how-cjk-sort-unicode-2">
       </a>
       <a name="idm46045055129360">
       </a>
       <p>
        <b>
         A.11.14.
        </b>
       </p>
      </td>
      <td align="left" valign="top">
       <p>
        Why do CJK strings sort incorrectly in Unicode? (II)
       </p>
      </td>
     </tr>
     <tr class="answer">
      <td align="left" valign="top">
      </td>
      <td align="left" valign="top">
       <p>
        CJK sorting problems that occurred in older MySQL versions can
        be solved as of MySQL 8.0 by using the
        <code class="literal">
         utf8mb4
        </code>
        character set and the
        <code class="literal">
         utf8mb4_ja_0900_as_cs
        </code>
        collation.
       </p>
      </td>
     </tr>
     <tr class="question">
      <td align="left" valign="top">
       <a name="faq-cjk-why-supplement-char-rejected">
       </a>
       <a name="idm46045055125824">
       </a>
       <p>
        <b>
         A.11.15.
        </b>
       </p>
      </td>
      <td align="left" valign="top">
       <p>
        Why are my supplementary characters rejected by MySQL?
       </p>
      </td>
     </tr>
     <tr class="answer">
      <td align="left" valign="top">
      </td>
      <td align="left" valign="top">
       <p>
        Supplementary characters lie outside the Unicode
        <span class="emphasis">
         <em>
          Basic
        Multilingual Plane / Plane 0
         </em>
        </span>
        . BMP characters have
        code point values between
        <code class="literal">
         U+0000
        </code>
        and
        <code class="literal">
         U+FFFF
        </code>
        . Supplementary characters have code
        point values between
        <code class="literal">
         U+10000
        </code>
        and
        <code class="literal">
         U+10FFFF
        </code>
        .
       </p>
       <p>
        To store supplementary characters, you must use a character set
        that permits them:
       </p>
       <div class="itemizedlist">
        <ul class="itemizedlist" style="list-style-type: disc; ">
         <li class="listitem">
          <p>
           The
           <code class="literal">
            utf8
           </code>
           and
           <code class="literal">
            ucs2
           </code>
           character sets support BMP characters only.
          </p>
          <p>
           The
           <code class="literal">
            utf8
           </code>
           character set permits only
           <code class="literal">
            UTF-8
           </code>
           characters that take up to three
            bytes. This has led to reports such as that found in Bug
            #12600, which we rejected as
           <span class="quote">
            “
            <span class="quote">
             not a bug
            </span>
            ”
           </span>
           . With
           <code class="literal">
            utf8
           </code>
           , MySQL must truncate an input string
            when it encounters bytes that it does no understand.
            Otherwise, it is unknown how long the bad multibyte
            character is.
          </p>
          <p>
           One possible workaround is to use
           <code class="literal">
            ucs2
           </code>
           instead of
           <code class="literal">
            utf8
           </code>
           , in which case the
           <span class="quote">
            “
            <span class="quote">
             bad
            </span>
            ”
           </span>
           characters are changed to question marks.
            However, no truncation takes place. You can also change the
            data type to
           <a class="link" href="blob.html" title="13.3.4 The BLOB and TEXT Types">
            <code class="literal">
             BLOB
            </code>
           </a>
           or
           <a class="link" href="binary-varbinary.html" title="13.3.3 The BINARY and VARBINARY Types">
            <code class="literal">
             BINARY
            </code>
           </a>
           , which perform no
            validity checking.
          </p>
         </li>
         <li class="listitem">
          <p>
           The
           <code class="literal">
            utf8mb4
           </code>
           ,
           <code class="literal">
            utf16
           </code>
           ,
           <code class="literal">
            utf16le
           </code>
           , and
           <code class="literal">
            utf32
           </code>
           character sets support BMP characters, as well as
            supplementary characters outside the BMP.
          </p>
         </li>
        </ul>
       </div>
      </td>
     </tr>
     <tr class="question">
      <td align="left" valign="top">
       <a name="faq-cjk-why-cjk-not-cjkv">
       </a>
       <a name="idm46045055105056">
       </a>
       <p>
        <b>
         A.11.16.
        </b>
       </p>
      </td>
      <td align="left" valign="top">
       <p>
        Should
        <span class="quote">
         “
         <span class="quote">
          CJK
         </span>
         ”
        </span>
        be
        <span class="quote">
         “
         <span class="quote">
          CJKV
         </span>
         ”
        </span>
        ?
       </p>
      </td>
     </tr>
     <tr class="answer">
      <td align="left" valign="top">
      </td>
      <td align="left" valign="top">
       <p>
        No. The term
        <span class="quote">
         “
         <span class="quote">
          CJKV
         </span>
         ”
        </span>
        (
        <span class="firstterm">
         Chinese Japanese Korean
        Vietnamese
        </span>
        ) refers to Vietnamese character sets which
        contain Han (originally Chinese) characters. MySQL supports the
        modern Vietnamese script with Western characters, but does not
        support the old Vietnamese script using Han characters.
       </p>
       <p>
        As of MySQL 5.6, there are Vietnamese collations for Unicode
        character sets, as described in
        <a class="xref" href="charset-unicode-sets.html" title="12.10.1 Unicode Character Sets">
         Section 12.10.1, “Unicode Character Sets”
        </a>
        .
       </p>
      </td>
     </tr>
     <tr class="question">
      <td align="left" valign="top">
       <a name="faq-cjk-how-cjk-db-table-names">
       </a>
       <a name="idm46045055099600">
       </a>
       <p>
        <b>
         A.11.17.
        </b>
       </p>
      </td>
      <td align="left" valign="top">
       <p>
        Does MySQL permit CJK characters to be used in database and
        table names?
       </p>
      </td>
     </tr>
     <tr class="answer">
      <td align="left" valign="top">
      </td>
      <td align="left" valign="top">
       <p>
        Yes.
       </p>
      </td>
     </tr>
     <tr class="question">
      <td align="left" valign="top">
       <a name="faq-cjk-where-doc-translations">
       </a>
       <a name="idm46045055097536">
       </a>
       <p>
        <b>
         A.11.18.
        </b>
       </p>
      </td>
      <td align="left" valign="top">
       <p>
        Where can I find translations of the MySQL Manual into Chinese,
        Japanese, and Korean?
       </p>
      </td>
     </tr>
     <tr class="answer">
      <td align="left" valign="top">
      </td>
      <td align="left" valign="top">
       <p>
        The Japanese translation of the MySQL 5.6 manual can be
        downloaded from
        <a class="ulink" href="/doc/" target="_top">
         https://dev.mysql.com/doc/
        </a>
        .
       </p>
      </td>
     </tr>
     <tr class="question">
      <td align="left" valign="top">
       <a name="faq-cjk-help-with-cjk">
       </a>
       <a name="idm46045055094912">
       </a>
       <p>
        <b>
         A.11.19.
        </b>
       </p>
      </td>
      <td align="left" valign="top">
       <p>
        Where can I get help with CJK and related issues in MySQL?
       </p>
      </td>
     </tr>
     <tr class="answer">
      <td align="left" valign="top">
      </td>
      <td align="left" valign="top">
       <p>
        The following resources are available:
       </p>
       <div class="itemizedlist">
        <ul class="itemizedlist" style="list-style-type: disc; ">
         <li class="listitem">
          <p>
           A listing of MySQL user groups can be found at
           <a class="ulink" href="https://wikis.oracle.com/display/mysql/List+of+MySQL+User+Groups" target="_blank">
            https://wikis.oracle.com/display/mysql/List+of+MySQL+User+Groups
           </a>
           .
          </p>
         </li>
         <li class="listitem">
          <p>
           View feature requests relating to character set issues at
           <a class="ulink" href="http://tinyurl.com/y6xcuf" target="_blank">
            http://tinyurl.com/y6xcuf
           </a>
           .
          </p>
         </li>
         <li class="listitem">
          <p>
           Visit the MySQL
           <a class="ulink" href="https://forums.mysql.com/list.php?103" target="_blank">
            Character Sets,
              Collation, Unicode Forum
           </a>
           .
           <a class="ulink" href="http://forums.mysql.com/" target="_blank">
            http://forums.mysql.com/
           </a>
           also provides
              foreign-language forums.
          </p>
         </li>
        </ul>
       </div>
       <p>
       </p>
      </td>
     </tr>
    </tbody>
   </table>
  </div>
 </div>
 <br/>
</div>
