0

I am creating an EER Model and want to find the collation that will provide me the most amount of characters to use. The characters that will be stored are generally standard English but on occasion the brands will have foreign and or accented characters. How can I ensure they are supported and not changed to squares or question marks down the road?

Generally I have them stored at UTF-16 but am not seeing that option available, in the default at least.

4

1 回答 1

1

您正在寻找的是字符集而不是排序规则。字符集定义了用于表示这些符号的符号集和编码。排序规则定义了用于比较给定字符集的字符并影响排序的规则。

Unicode 字符集提供最广泛的字符支持。MySQL 支持两种 Unicode 编码:

  • UTF8 - 最多使用 24 位来编码一个字符,向后兼容 ASCII 编码。
  • UCS2 - 始终使用 16 位对每个字符进行编码,与 ASCII 编码不兼容。

在这两个字符集中,MySQL 有多个排序规则,它们指定不同语言的排序规则、Unicode 规则和二进制比较规则。

查看: MySQL 参考手册中的字符集支持

于 2012-10-17T18:55:30.893 回答