In. net
System. Text. encoding. Default. getbytes (strdata)
Both Chinese characters and Kana take up two bytes.
But in Android,
Originalchar. getbytes (). Length
In the UFT-8 encoding format, both Chinese characters and Kana take up three bytes.
The number of characters in each encoding format is listed below:
English letter:
Number of bytes: 1; encoding: gb2312 Bytes: 1; encoding: GBK number of bytes: 1; encoding: gb18030 Bytes: 1; encoding: ISO-8859-1 number of bytes: 1; encoding: number of UTF-8 Bytes: 4; encoding: UTF-16 Bytes: 2; encoding: UTF-16BE Bytes: 2; encoding: UTF-16LE
Chinese characters: Man
Number of bytes: 2; encoding: gb2312 Bytes: 2; encoding: GBK number of bytes: 2; encoding: gb18030 Bytes: 1; encoding: ISO-8859-1 number of bytes: 3; encoding: number of UTF-8 Bytes: 4; encoding: UTF-16 Bytes: 2; encoding: UTF-16BE Bytes: 2; encoding: UTF-16LE