8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

正文为中文,英文原文默认隐藏。点击任意中文段落即可展开 / 收起对应英文原文。

打开官方英文原文 ↗

译文由机器翻译生成,仅供理解参考;有疑问请以官方英文原文为准。

MySQL 8.4 参考手册 / 12 种字符集、排序规则、Unicode / 12.13 添加字符集 / 12.13.2 复杂字符集的字符串整理支持
中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 100%

12.13.2 复杂字符集的字符串排序支持12.13.2 String Collating Support for Complex Character Sets

对于名为 MYSET 的简单字符集,排序规则在 MYSET.xml 配置文件中通过 <collation> 元素内的 <map> 数组元素来指定。如果您的语言的排序规则过于复杂,无法通过简单数组处理,则必须在 strings 目录中的 ctype-MYSET.c 源文件中定义字符串对照函数。For a simple character set named MYSET, sorting rules are specified in the MYSET.xml configuration file using <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-MYSET.c source file in the strings 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.