文档首页
MySQL 8.4 参考手册
8.4 中文镜像

MySQL 8.4 参考手册 · 中文镜像

正文为中文,英文原文默认隐藏。点击任意中文段落即可展开 / 收起对应英文原文。

打开官方英文原文 ↗

译文由机器翻译生成,仅供理解参考;有疑问请以官方英文原文为准。

MySQL 8.4 参考手册 / 12 种字符集、排序规则、Unicode / 12.9 统一码支持 / 12.9.4 ucs2 字符集(UCS-2 Unicode 编码)
中文点击中文段落可显示 / 隐藏英文原文本页译文覆盖 100%

12.9.4 ucs2 字符集(UCS-2 Unicode 编码)12.9.4 The ucs2 Character Set (UCS-2 Unicode Encoding)

Note

ucs2 字符集已被弃用;预计将在未来的 MySQL 版本中移除。你应该改用 utf8mb4。The ucs2 character set is deprecated; expect it to be removed in a future MySQL release. You should use utf8mb4 instead.

在 UCS-2 中,每个字符由一个 2 字节的 Unicode 代码表示,最高有效字节在前。例如:LATIN CAPITAL LETTER A 的代码是 0x0041,它存储为 2 字节序列:0x00 0x41。CYRILLIC SMALL LETTER YERU(Unicode 0x044B)存储为 2 字节序列:0x04 0x4B。有关 Unicode 字符及其代码,请参考 Unicode 联盟网站。In UCS-2, every character is represented by a 2-byte Unicode code with the most significant byte first. For example: LATIN CAPITAL LETTER A has the code 0x0041 and it is stored as a 2-byte sequence: 0x00 0x41. CYRILLIC SMALL LETTER YERU (Unicode 0x044B) is stored as a 2-byte sequence: 0x04 0x4B. For Unicode characters and their codes, please refer to the Unicode Consortium website.

ucs2 字符集具有以下特性:The ucs2 character set has these characteristics:

  • 仅支持 BMP 字符(不支持补充字符)Supports BMP characters only (no support for supplementary characters)

  • 使用固定长度的 16 位编码,每个字符需要两个字节。Uses a fixed-length 16-bit encoding and requires two bytes per character.