utf-8,utf-7,unicode的编码的区别有什么?
今天上csdn论坛时看到一个关于utf-8,utf-7......几种编码的区别,说法不一,虽然经常使用这几种编码,咋一想,还真有点模糊,于是百度一下,找了一些相关文章,总结如下(仅代表个人观点):
unicode:
每个字符2个字节
utf-8:
英文字符即能用8位表示的字符用1个字节表示
能用8 到 11位 表示的字符用2个字节表示
能用12 到 16 位表示的字符用2个字节表示
utf-7:
遇英语字母、数字和常见符号直接用8位表示(不过我也没搞清楚什么时常见符号,如"&"符就会当成非常见字符。。。)
其他的符号串用+-来标记始终,如"a中中a"
在遇到中时会如下编码
a的编码 +的编码 中的编码 中的编码 -的编码 a的编码
共6个字节。。。
测试代码

























本文地址:http://www.45fan.com/a/question/67900.html