Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何转换U+0065为 UTF-32 格式?
U+0065
U+0065 0000 0000 0110 0101 UTF-32 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxxx
将 U+0065 转换为 UTF-32:
0000 0000 0000 0000 0000 0000 0110 0101
十六进制的结果是0x00000065
0x00000065
那是对的吗 ?
是的,这是正确的。
UTF-32 始终使用 32 位编写。Unicode 定义了高达 U+10FFFF 的代码点,它使用 21 位。因此 UTF-32 值始终与代码点本身相同。
因为 U+0065 在 U+0000..U+007F 范围内,所以它使用 8 位 ( 01100101) 以 UTF-8 编写。在 UTF-16 中,使用 16 位 ( 00000000 01100101) 和在 UTF-32 中使用 32 位 ( 00000000 00000000 00000000 01100101) 相同。
01100101
00000000 01100101
00000000 00000000 00000000 01100101