UTF-8 

UTF-8
语言國際
标准Unicode
分类EASCII
变长编码
Unicode转换格式
拓展自US-ASCII
变换/编码ISO 10646 (Unicode)
前用UTF-1
顯示了谷歌所記錄的2001年至2012年主要編碼方法的使用情況,[1]2008年,UTF-8的使用率超过所有其他编码方式,在2012年超过所有网页的60%。其中ASCII only曲线包括所有仅包含ASCII字符的网页,无论元数据中声明如何。

UTF-88-bit Unicode Transformation Format)是一種針對Unicode可變長度字元編碼,也是一种前缀码。它可以用一至四个字节对Unicode字符集中的所有有效编码点进行编码,属于Unicode标准的一部分,最初由肯·汤普逊罗布·派克提出。[2][3]由于较小值的编码点一般使用频率较高,直接使用Unicode编码效率低下,大量浪费内存空间。UTF-8就是为了解决向后兼容ASCII码而设计,Unicode中前128个字符,使用与ASCII码相同的二进制值的单个字节进行编码,而且字面与ASCII码的字面一一对应,這使得原來處理ASCII字元的軟體無須或只須做少部份修改,即可繼續使用。因此,它逐漸成為電子郵件網頁及其他儲存或傳送文字優先採用的編碼方式。

自2009年以来,UTF-8一直是万维网的最主要的编码形式(对所有,而不仅是Unicode范围内的编码)(并由WHATWG宣布为强制性的“适用于所有事物(for all things)”,[4]截止到2019年11月, 在所有网页中,UTF-8编码应用率高达94.3%(其中一些仅是ASCII编码,因为它是UTF-8的子集),而在排名最高的1000个网页中占96%。[5] 第二热门的多字节编码方式Shift JIS和GB 2312分别具有0.3%和0.2%的占有率。[6][7][1]Internet邮件联盟( Internet Mail Consortium, IMC)建议所有电子邮件程序都能够使用UTF-8展示和创建邮件,[8] W3C建议UTF-8作为XML文件和HTML文件的默认编码方式。[9]網際網路工程工作小組(IETF)要求所有網際網路協議都必須支持UTF-8編碼[10]互聯網郵件聯盟(IMC)建議所有電子郵件軟件都支持UTF-8編碼。[11]

  1. ^ 1.0 1.1 Davis, Mark. Unicode over 60 percent of the web. Official Google Blog. 2012-02-03 [2019-11-23]. (原始内容存档于2018-08-09). 
  2. ^ Pike, Rob. UTF-8 history. 2003-04-30 [2019-11-23]. (原始内容存档于2006-10-29). ...UTF-8 was designed, in front of my eyes, on a placemat in a New Jersey diner one night in September or so 1992...So that night Ken wrote packing and unpacking code and I started tearing into the C and graphics libraries. The next day all the code was done... .
  3. ^ Pike, Rob; Thompson, Ken. Hello World or Καλημέρα κόσμε or こんにちは 世界 (PDF). Proceedings of the Winter 1993 USENIX Conference. 1993 [2019-11-23]. (原始内容存档 (PDF)于2017-10-11). 
  4. ^ Encoding Standard. encoding.spec.whatwg.org. [2019-11-23]. (原始内容存档于2015-02-04) (英语). The problems outlined here go away when exclusively using UTF-8, which is one of the many reasons that is now the mandatory encoding for all things. 
  5. ^ Usage Survey of Character Encodings broken down by Ranking. w3techs.com. [2019-11-23]. (原始内容存档于2022-01-21) (英语). 
  6. ^ Historical trends in the usage of character encodings. [2019-11-14]. 
  7. ^ UTF-8 Usage Statistics. BuiltWith. [2011-03-28]. (原始内容存档于2021-12-07). 
  8. ^ Using International Characters in Internet Mail. Internet Mail Consortium. 1998-08-01 [2007-11-08]. (原始内容存档于2007-10-26). 
  9. ^ Specifying the document's character encoding, HTML5.2, World Wide Web Consortium, 14 December 2017 [2018-06-03], (原始内容存档于2019-06-13) 
  10. ^ 參考RFC 2277 section 3.1
  11. ^ Using International Characters in Internet Mail. 2007-10-26 [2018-07-27]. 原始内容存档于2007-10-26. 



取材自維基百科 - 中文時事百科