MySQL字符存储:charset-unicode-sets

Posted 数据库技术和故事

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MySQL字符存储:charset-unicode-sets相关的知识,希望对你有一定的参考价值。

https://dev.mysql.com/doc/refman/8.0/en/charset-unicode-sets.html

 

10.10.1 Unicode Character Sets

MySQL supports multiple Unicode character sets:

  • utf8mb4: A UTF-8 encoding of the Unicode character set using one to four bytes per character.

  • utf8mb3: A UTF-8 encoding of the Unicode character set using one to three bytes per character.

  • utf8: An alias for utf8mb3.

  • ucs2: The UCS-2 encoding of the Unicode character set using two bytes per character.

  • utf16: The UTF-16 encoding for the Unicode character set using two or four bytes per character. Like ucs2 but with an extension for supplementary characters.

  • utf16le: The UTF-16LE encoding for the Unicode character set. Like utf16 but little-endian rather than big-endian.

  • utf32: The UTF-32 encoding for the Unicode character set using four bytes per character.

Note

The utf8mb3 character set is deprecated and will be removed in a future MySQL release. Please use utf8mb4 instead. Although utf8 is currently an alias for utf8mb3, at that point utf8 will become a reference to utf8mb4. To avoid ambiguity about the meaning of utf8, consider specifying utf8mb4 explicitly for character set references instead of utf8.

 

以上是关于MySQL字符存储:charset-unicode-sets的主要内容,如果未能解决你的问题,请参考以下文章

在 MySQL 表中存储英文和中文字符的正确字符集是啥?

在 MySQL 中存储特殊字符

MySQL 不想存储 unicode 字符

MySQL中数组的存储

为啥存储过程没有在一个字符串中给出输出并且在 MySql 6.0 上执行的存储过程在 MySql 5.0 上给出错误

mysql - 如何确定存储可变字符串的字段的长度?