是否有任何字符编码,其中0字节不编码null,但编码更可协调的字符? 我的PHP给了我这个编码列表:
[0] => pass
[1] => auto
[2] => wchar
[3] => byte2be
[4] => byte2le
[5] => byte4be
[6] => byte4le
[7] => BASE64
[8] => UUENCODE
[9] => HTML-ENTITIES
[10] => Quoted-Printable
[11] => 7bit
[12] => 8bit
[13] => UCS-4
[14] => UCS-4BE
[15] => UCS-4LE
[16] => UCS-2
[17] => UCS-2BE
[18] => UCS-2LE
[19] => UTF-32
[20] => UTF-32BE
[21] => UTF-32LE
[22] => UTF-16
[23] => UTF-16BE
[24] => UTF-16LE
[25] => UTF-8
[26] => UTF-7
[27] => UTF7-IMAP
[28] => ASCII
[29] => EUC-JP
[30] => SJIS
[31] => eucJP-win
[32] => SJIS-win
[33] => CP932
[34] => CP51932
[35] => JIS
[36] => ISO-2022-JP
[37] => ISO-2022-JP-MS
[38] => Windows-1252
[39] => Windows-1254
[40] => ISO-8859-1
[41] => ISO-8859-2
[42] => ISO-8859-3
[43] => ISO-8859-4
[44] => ISO-8859-5
[45] => ISO-8859-6
[46] => ISO-8859-7
[47] => ISO-8859-8
[48] => ISO-8859-9
[49] => ISO-8859-10
[50] => ISO-8859-13
[51] => ISO-8859-14
[52] => ISO-8859-15
[53] => ISO-8859-16
[54] => EUC-CN
[55] => CP936
[56] => HZ
[57] => EUC-TW
[58] => BIG-5
[59] => EUC-KR
[60] => UHC
[61] => ISO-2022-KR
[62] => Windows-1251
[63] => CP866
[64] => KOI8-R
[65] => KOI8-U
[66] => ArmSCII-8
[67] => CP850
[68] => JIS-ms
[69] => CP50220
[70] => CP50220raw
[71] => CP50221
[72] => CP50222
答案 0 :(得分:2)
任何简单的多字节编码(例如,所有形式的UTF-16)都将每个代码点表示为两个字节,其中一个为零。因此,例如U + 0020将表示为0x00 0x20(大端)或0x20 0x00(小端)。类似地,任何256的偶数乘积的字符都将具有0x00的LSB。
答案 1 :(得分:0)
经典地,在C中,零字节用于标记字符串的结尾。在PHP中,字符串实际上可以包含零字节,但据我所知,没有字符编码将zerobyte编码为可打印字符。