gpt4 book ai didi

mysql - MariaDB/MySQL 中 utf8mb4_unicode_ci 和 utf8mb4_unicode_520_ci 排序规则的区别?

转载 作者:IT老高 更新时间:2023-10-28 23:46:46 24 4
gpt4 key购买 nike

我登录到 MariaDB/MySQL 并输入:

SHOW COLLATION;

我在可用排序规则中看到 utf8mb4_unicode_ciutf8mb4_unicode_520_ci。这两种归类之间有什么区别,我们应该使用哪种?

最佳答案

好吧,您可以阅读文档中的差异。我不能告诉你应该使用什么,因为每个项目都不一样。

10.1.3 Collation Naming Conventions

MySQL collation names follow these conventions:

A collation name starts with the name of the character set with whichit is associated, followed by one or more suffixes indicating othercollation characteristics. For example, utf8_general_ci andlatin_swedish_ci are collations for the utf8 and latin1 charactersets, respectively.

A language-specific collation includes a language name. For example,utf8_turkish_ci and utf8_hungarian_ci sort characters for the utf8character set using the rules of Turkish and Hungarian, respectively.

Case sensitivity for sorting is indicated by _ci (case insensitive),_cs (case sensitive), or _bin (binary; character comparisons are based on character binary code values). For example, latin1_general_ci iscase insensitive, latin1_general_cs is case sensitive, and latin1_binuses binary code values.

For Unicode, collation names may include a version number to indicatethe version of the Unicode Collation Algorithm (UCA) on which thecollation is based. UCA-based collations without a version number inthe name use the version-4.0.0 UCA weight keys. For example:

utf8_unicode_ci (with no version named) is based on UCA 4.0.0 weightkeys >(http://www.unicode.org/Public/UCA/4.0.0/allkeys-4.0.0.txt).

utf8_unicode_520_ci is based on UCA 5.2.0 weight keys(http://www.unicode.org/Public/UCA/5.2.0/allkeys.txt).

For Unicode, the xxx_general_mysql500_ci collations preserve thepre-5.1.24 ordering of the original xxx_general_ci collations andpermit upgrades for tables created before MySQL 5.1.24. For moreinformation, see Section 2.11.3, “Checking Whether Tables or IndexesMust Be Rebuilt”, and Section 2.11.4, “Rebuilding or Repairing Tablesor Indexes”.

Source

关于mysql - MariaDB/MySQL 中 utf8mb4_unicode_ci 和 utf8mb4_unicode_520_ci 排序规则的区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37307146/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com