对于名为 MYSET 的简单字符集,排序规则在 配置文件中通过 MYSET.xml<collation> 元素内的 <map> 数组元素来指定。如果您的语言的排序规则过于复杂,无法通过简单数组处理,则必须在 strings 目录中的 ctype- 源文件中定义字符串对照函数。For a simple character set named
MYSET.cMYSET, sorting rules are specified in
the
configuration file using MYSET.xml<map> array
elements within <collation> 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
ctype-
source file in the MYSET.cstrings directory.
现有的字符集提供了展示这些函数是如何实现的最佳文档和示例。查看 strings 目录中的 ctype-*.c 文件,例如 big5、czech、gbk、sjis 和 tis160 字符集的文件。查看 MY_COLLATION_HANDLER 结构体以了解它们是如何使用的。另请参阅 strings 目录中的 CHARSET_INFO.txt 文件以获取更多信息。The existing character sets provide the best documentation and
examples to show how these functions are implemented. Look at
the ctype-*.c files in the
strings directory, such as the files for
the big5, czech,
gbk, sjis, and
tis160 character sets. Take a look at the
MY_COLLATION_HANDLER structures to see how
they are used. See also the
CHARSET_INFO.txt file in the
strings directory for additional
information.