字符集,排序规则,Unicode

2019-12-22  本文已影响0人  szn好色仙人

序言

show character set;
--查看mysql支持的字符集,部分输出如下
Character Describption Default collation Maxlen
ascii US ASCII ascii_general_ci 1
big5 Big5 Traditional Chinese(繁体中文) big5_chinese_ci 2
binary Binary pseudo charset binary 1
gb18030 China National Standard GB18030 gb18030_chinese_ci 4
gb2312 GB2312 Simplified Chinese gb2312_chinese_ci 2
gbk GBK Simplified Chinese gbk_chinese_ci 2
utf16 UTF-16 Unicode utf16_general_ci 4
utf16le UTF-16LE Unicode utf16le_general_ci 4
utf32 UTF-32 Unicode utf32_general_ci 4
utf8 UTF-8 Unicode utf8_general_ci 3
utf8mb4 UTF-8 Unicode utf8mb4_0900_ai_ci 4
show collation;
--查看mysql支持的collation

指定字符集与排序规则

服务器的字符集与排序规则

数据库的字符集与排序规则

表的字符集与排序规则

列的字符集与排序规则

字符串字面量的字符集与排序规则

Character Set Introducers

连接的字符集与排序规则

Unicode支持

​ The Unicode Standard includes characters from the Basic Multilingual(使用多种语言的) Plane (BMP) and supplementary(追加的) characters that lie outside the BMP.

​ BMP characters have these characteristics:

​ Supplementary characters lie outside the BMP:

mysql支持的unicode

字符集 单个字符占用空间 支持的字符 描述
utf8mb4 1到4字节 BMP and supplementary A UTF-8 encoding of the Unicode character set
utf8mb3 1到3字节 BMP only A UTF-8 encoding of the Unicode character set
utf8 1到3字节 BMP only An alias for utf8mb3.
ucs2 2字节 BMP and supplementary The UCS-2 encoding of the Unicode character set
utf16 2或4字节 BMP and supplementary The UTF-16 encoding for the Unicode character set . Like ucs2 but with an extension for supplementary characters.
utf16le 2或4字节 BMP and supplementary The UTF-16LE encoding for the Unicode character set. Like utf16 but little-endian rather than big-endian.
utf32 4字节 BMP and supplementary The UTF-32 encoding for the Unicode character set
上一篇 下一篇

猜你喜欢

热点阅读