gpt4 book ai didi

mysql - MySQL 中的 utf8_general_ci 和 utf8_unicode_ci 有什么区别?

转载 作者:行者123 更新时间:2023-11-29 03:46:44 25 4
gpt4 key购买 nike

一段时间以来,我一直使用 phpMyAdmin 来管理本地 MySQL 数据库。我开始接受的一件事是我的数据库的正确字符集。我已经确定 UTF-8 是兼容性最好的(因为我的 XHTML 模板作为 UTF-8 使用)但让我感到困惑的一件事是我在 phpMyAdmin 界面中看到的 UTF-8 的各种选项?

我隔离的两个是:

  • utf8_general_ci
  • utf8_unicode_ci

所以我的问题是:MySQL 中 utf8generalunicode 变体有什么区别? (我了解到 ci 是不区分大小写的简写)

在这件事上任何帮助将不胜感激。

最佳答案

来自MySQL manual on Unicode Character Sets :

For any Unicode character set, operations performed using the _general_ci collation are faster than those for the _unicode_ci collation. For example, comparisons for the utf8_general_ci collation are faster, but slightly less correct, than comparisons for utf8_unicode_ci. The reason for this is that utf8_unicode_ci supports mappings such as expansions; that is, when one character compares as equal to combinations of other characters. For example, in German and some other languages “ß” is equal to “ss”. utf8_unicode_ci also supports contractions and ignorable characters. utf8_general_ci is a legacy collation that does not support expansions, contractions, or ignorable characters. It can make only one-to-one comparisons between characters.

参见 further information and examples 的引用页.

关于mysql - MySQL 中的 utf8_general_ci 和 utf8_unicode_ci 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3337863/

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