51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

查看: 7081|回复: 11
打印 上一主题 下一主题

[求助]UTF-8和UTF-16的区别

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2010-5-6 14:34:38 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
知道的说下,谢谢~
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
发表于 2010-5-11 15:45:32 | 只看该作者
UTF-8 is the byte-oriented encoding form of Unicode. For details of its definition, see Section 2.5 “Encoding Forms” and Section 3.9 “ Unicode Encoding Forms ” in the Unicode Standard. See, in particular, Table 3-6 UTF-8 Bit Distribution and Table 3-7 Well-formed UTF-8 Byte Sequences, which give succinct summaries of the encoding form. Make sure you refer to the latest version of the Unicode Standard, as the  Unicode Technical Committee has tightened the definition of UTF-8 over time to more strictly enforce unique sequences and to prohibit encoding of certain invalid characters. There is an Internet RFC 3629 about UTF-8. UTF-8 is also defined in Annex D of ISO/IEC 10646.

       UTF-16 uses a single 16-bitcode unit to encode the most common 63K characters, and a pair of 16-bit code unites, called surrogates, to encode the 1M less commonly used characters in Unicode.Originally, Unicode was designed as a pure 16-bit encoding, aimed at representing all modern scripts. (Ancient scripts were to be represented with private-use characters.) Over time, and especially after the addition of over 14,500 composite characters for compatibility with legacy sets, it became clear that 16-bits were not sufficient for the user community. Out of this arose UTF-16.

from "http://unicode.org/faq/utf_bom.html#UTF16 "
回复 支持 反对

使用道具 举报

  • TA的每日心情

    2018-4-24 11:12
  • 签到天数: 55 天

    连续签到: 1 天

    [LV.5]测试团长

    3#
    发表于 2010-5-12 18:03:30 | 只看该作者
    UTF-8, 8bit编码, ASCII不作变换, 其他字符做变长编码, 每个字符1-3 byte. 通常作为外码. 有以下优点:
    * 与CPU字节顺序无关, 可以在不同平台之间交流
    * 容错能力高, 任何一个字节损坏后, 最多只会导致一个编码码位损失, 不会链锁错误(如GB码错一个字节就会整行乱码)

    UTF-16, 16bit编码, 是变长码, 大致相当于20位编码, 值在0到0x10FFFF之间, 基本上就是unicode编码的实现. 它是变长码, 与CPU字序有关, 但因为最省空间, 常作为网络传输的外码.
    回复 支持 反对

    使用道具 举报

  • TA的每日心情

    2018-4-24 11:12
  • 签到天数: 55 天

    连续签到: 1 天

    [LV.5]测试团长

    4#
    发表于 2010-5-12 18:04:18 | 只看该作者
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    5#
    发表于 2010-10-15 23:53:47 | 只看该作者
    学习了,经常见,却从没想过为什么
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    开心
    2016-2-15 09:02
  • 签到天数: 7 天

    连续签到: 1 天

    [LV.3]测试连长

    6#
    发表于 2010-11-2 15:12:01 | 只看该作者
    来学习哈
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    7#
    发表于 2010-11-19 20:41:10 | 只看该作者
    了解 了
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    8#
    发表于 2011-1-27 10:47:08 | 只看该作者
    学习了
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    奋斗
    2016-7-13 17:21
  • 签到天数: 11 天

    连续签到: 1 天

    [LV.3]测试连长

    9#
    发表于 2011-2-10 17:12:58 | 只看该作者
    学习
    回复 支持 反对

    使用道具 举报

  • TA的每日心情

    2019-12-27 13:32
  • 签到天数: 15 天

    连续签到: 1 天

    [LV.4]测试营长

    10#
    发表于 2011-4-15 15:48:51 | 只看该作者
    UTF-8, 8bit编码, ASCII不作变换, 其他字符做变长编码, 每个字符1-3 byte. 通常作为外码. 有以下优点:
    * 与CPU字节顺序无关, 可以在不同平台之间交流
    * 容错能力高, 任何一个字节损坏后, 最多只会导致一个编码码位损失, 不会链锁错误(如GB码错一个字节就会整行乱码)

    UTF-16, 16bit编码, 是变长码, 大致相当于20位编码, 值在0到0x10FFFF之间, 基本上就是unicode编码的实现. 它是变长码, 与CPU字序有关, 但因为最省空间, 常作为网络传输的外码.
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    11#
    发表于 2011-4-15 15:52:00 | 只看该作者
    上海熟悉Junit tester ,英语口语好,5年+,年薪20--30万
    上海, 英语口语, 软件开发英语口语, 上海, tester, 年薪, Junit
    senior tester ,有机会做Tech Leader.
    要求有软件开发经验,能写自动化测试脚本,优先考虑做性能测试的,优先考虑用过Junit的(Junit就是用脚本写的自动化测试工具),不要做手动测试的


    MSN:zxsh3598@hotmail.com
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    12#
    发表于 2012-2-9 17:10:34 | 只看该作者
    学习了
    回复 支持 反对

    使用道具 举报

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条

    小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

    GMT+8, 2024-5-2 05:03 , Processed in 0.070861 second(s), 27 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

    快速回复 返回顶部 返回列表