<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="string-collating">
      </a>
      12.13.2 String Collating Support for Complex Character Sets
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045215314784">
  </a>
  <a class="indexterm" name="idm46045215313328">
  </a>
  <p>
   For a simple character set named
   <em class="replaceable">
    <code>
     MYSET
    </code>
   </em>
   , sorting rules are specified in
        the
   <code class="filename">
    <em class="replaceable">
     <code>
      MYSET
     </code>
    </em>
    .xml
   </code>
   configuration file using
   <code class="literal">
    &lt;map&gt;
   </code>
   array
        elements within
   <code class="literal">
    &lt;collation&gt;
   </code>
   elements.
        If the sorting rules for your language are too complex to be
        handled with simple arrays, you must define string collating
        functions in the
   <code class="filename">
    ctype-
    <em class="replaceable">
     <code>
      MYSET
     </code>
    </em>
    .c
   </code>
   source file in the
   <code class="filename">
    strings
   </code>
   directory.
  </p>
  <p>
   The existing character sets provide the best documentation and
        examples to show how these functions are implemented. Look at
        the
   <code class="filename">
    ctype-*.c
   </code>
   files in the
   <code class="filename">
    strings
   </code>
   directory, such as the files for
        the
   <code class="literal">
    big5
   </code>
   ,
   <code class="literal">
    czech
   </code>
   ,
   <code class="literal">
    gbk
   </code>
   ,
   <code class="literal">
    sjis
   </code>
   , and
   <code class="literal">
    tis160
   </code>
   character sets. Take a look at the
   <code class="literal">
    MY_COLLATION_HANDLER
   </code>
   structures to see how
        they are used. See also the
   <code class="filename">
    CHARSET_INFO.txt
   </code>
   file in the
   <code class="filename">
    strings
   </code>
   directory for additional
        information.
  </p>
 </div>
 <br/>
</div>
