对Unicode的误解
来源:互联网 发布:28大神软件下载 编辑:程序博客网 时间:2024/06/08 11:33
前几天看了一本Sybex出版的关于Java认证的书:Complete Java 2 Certification Study Guide fifth edition。
在其312页(Chapter 9 I/O and Streams),关于对Unicode的描述,原文如下:
Clearly, 8 bits are not enough to represent all the characters of all the communities of our planet. The Unicode standard was developed as a way to map characters to 16-bit values. Using 16 bits means that there are 65,536 possible characters that can be represented, so almost all languages can be fully encoded. (Chinese, Japanese, and Korean, which have huge numbers of characters, are not completely represented.)
读了该文,我们会这样理解:由于用8个bit对所有字符进行编码不够,所以Unicode就用16个bit对字符进行编码,这样就基本够用了(除了中文、日语等)。
这样描述是错误的,Unicode标准中有多种字符编码方式,包括:UTF-8、UTF-16、UTF-32。
UTF-8以8个bit作为一个单元(即code unit)对字符进行编码。一个字符的编码将由1个8-bit或多个8-bit(不超过4个8-bit)组成。
UTF-16以16个bit作为一个单元(即code unit)对字符进行编码。一个字符的编码将由1个或2个16-bit组成。
UTF-32以32个bit作为一个单元(即code unit)对字符进行编码。一个字符的编码将由1个32-bit组成。
- 对Unicode的误解
- 对perl的误解
- 对DllMain的误解
- 对新能源的误解
- 对程序员的误解
- 对SDN的误解
- 对HTML的误解
- 对于 Unicode 、GBK、BIG5 的误解
- 对while语句的误解
- 社会教育对"近视"的误解
- 对Linux安全性的误解
- 对html table的误解
- 企业对电子商务的误解
- 对眼睛的九个误解
- 对敏捷开发的误解
- 对Grails的一些误解
- 对while语句的误解
- 对敏捷开发的误解
- 开发JAVA编程中字符串分割的两种方法
- 存储过程解密(破解函数,过程,触发器,视图.仅限于SQLSERVER2000)
- Test1
- Servlet中的八大Listener
- Test2
- 对Unicode的误解
- Python中关于属性回调的实现
- 考研日志-23
- Boost.Signals简介
- vs2005的一个新东东‘SetCompatibleTextRenderingDefault’
- 在MSSQL中用查询分析器显示Long Text的内容
- C++ Standard Library Style Guidelines
- Web开发的常见问题解答
- Protel的下载地址和学习资料