编辑器(Win记事本、Sublime、Notepad++)对常见字符编码的处理和区别:GB2312、GBK、ANSI、Unicode、UTF-8

字符编码

UTF-8的一个特别的好处是它与ISO-8859-1完全兼容,可以表示世界上所有的字符,汉字通常用3个字节来表示。
GB2312的code page是CP20936。GBK的code page是CP936。GB18030支持的字符数更多。GB2312、GBK、GB18030均为双字节。
注意:<>GB2312、GBK、GB18030都是以ANSI格式存储的。

windows notepad、windows notepad++和sublime text的字符编码显示区别:

windows notepad notepad++ sublime text
ANSI ANSI GB2312
Unicode UCS-2 LE BOM UTF-16LE
Unicode big endian UCS-2 BE BOM Detected UTF-16BE vs UTF-16BE with BOM with 100% confidence
UTF-8 UTF-8-BOM Detected UTF-8 vs UTF-8 with BOM with 100% confidence

参考资料

中文字符集编码Unicode ,gb2312 , cp936 ,GBK,GB18030

猜你喜欢

转载自blog.csdn.net/xuejianhui/article/details/52576771