什么叫 “Unicode格式 字符” ??

来源:百度知道 编辑:UC知道 时间:2024/06/14 11:12:54

UTF8 == Unicode Transformation Format -- 8 bit
是Unicode传送格式。即把Unicode文件转换成BYTE的传送流。

UTF8流的转换程序:
Input: unsigned integer c - the code point of the character to be encoded (输入一个unicode值)
Output: byte b1, b2,b3, b4 - the encoded sequence of bytes (输出四个BYTE值)
Algorithm(算法):
if (c<0x80)
b1 = c>>0 & 0x7F | 0x00
b2 = null
b3 = null
b4 = null
else if (c<0x0800)
b1 = c>>6 & 0x1F | 0xC0
b2 = c>>0 & 0x3F | 0x80
b3 = null
b4 = null
else if (c<0x010000)
b1 = c>>12 & 0x0F | 0xE0
b2 = c>>6 & 0x3F | 0x80
b3 = c>>0 & 0x3F | 0x80
b4 = null
else if (c<0x110000)
b1 = c>>18 & 0x07 | 0xF0
b2 = c>>12 & 0x3F | 0x80
b3 = c>>6 & 0x3F | 0x80
b4 = c>>0 & 0x3F | 0x80
end if
=====================
unicode 是一种编码表格,例如,给一个汉字规定一个代码。类似 GB2312-1980, GB18030等,只不过字集不同。
===========