MariaDB/MySQL中的utf8mb4_unicode_ci和utf8mb4_unicode_520_ci归类之间的区别? [英] Difference between utf8mb4_unicode_ci and utf8mb4_unicode_520_ci collations in MariaDB/MySQL?

查看:462
本文介绍了MariaDB/MySQL中的utf8mb4_unicode_ci和utf8mb4_unicode_520_ci归类之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我登录了MariaDB/MySQL并输入:

I logged into MariaDB/MySQL and entered:

SHOW COLLATION;

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

I see utf8mb4_unicode_ci and utf8mb4_unicode_520_ci among the available collations. What is the difference between these two collations and which should we be using?

推荐答案

您应该阅读文档.我无法告诉您应该使用什么,因为每个项目都是不同的.

Well you shall need to read in to the documentation. I can't tell you what you should be using because every project is different.

MySQL归类名称遵循以下约定:

MySQL collation names follow these conventions:

排序规则名称以与之关联的字符集的名称开头,后跟一个或多个后缀,表示其他排序规则特性.例如,utf8_general_ci和latin_swedish_ci分别是utf8和latin1字符集的排序规则.

A collation name starts with the name of the character set with which it is associated, followed by one or more suffixes indicating other collation characteristics. For example, utf8_general_ci and latin_swedish_ci are collations for the utf8 and latin1 character sets, respectively.

特定于语言的归类包括语言名称.例如,utf8_turkish_ci和utf8_hungarian_ci分别使用土耳其语和匈牙利语规则对utf8字符集的字符进行排序.

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

排序的大小写敏感性由_ci(不区分大小写),_ cs(区分大小写)或_bin(二进制;字符比较基于字符二进制代码值)表示.例如,latin1_general_ci不区分大小写,latin1_general_cs区分大小写,latin1_bin使用二进制代码值.

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 is case insensitive, latin1_general_cs is case sensitive, and latin1_bin uses binary code values.

对于Unicode,归类名称可能包括版本号,以指示归类所基于的Unicode归类算法(UCA)的版本.在名称中没有版本号的基于UCA的归类使用版本4.0.0 UCA配重键.例如:

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

utf8_unicode_ci(未命名版本)基于UCA 4.0.0重量键>(

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

utf8_unicode_520_ci基于UCA 5.2.0重量键( http://www.unicode. org/Public/UCA/5.2.0/allkeys.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).

对于Unicode,xxx_general_mysql500_ci归类保留原始xxx_general_ci归类在5.1.24之前的顺序,并允许升级在MySQL 5.1.24之前创建的表.有关更多信息,请参见第2.11.3节检查是否必须重建表或索引"和第2.11.4节重建或修复表或索引".

For Unicode, the xxx_general_mysql500_ci collations preserve the pre-5.1.24 ordering of the original xxx_general_ci collations and permit upgrades for tables created before MySQL 5.1.24. For more information, see Section 2.11.3, "Checking Whether Tables or Indexes Must Be Rebuilt", and Section 2.11.4, "Rebuilding or Repairing Tables or Indexes".

来源: https://dev.mysql.com/doc/refman /5.6/zh-CN/charset-collat​​ion-names.html

这篇关于MariaDB/MySQL中的utf8mb4_unicode_ci和utf8mb4_unicode_520_ci归类之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆