Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1444911
  • 博文数量: 295
  • 博客积分: 10051
  • 博客等级: 上将
  • 技术积分: 3850
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-11 08:50
文章分类

全部博文(295)

文章存档

2011年(1)

2009年(4)

2008年(290)

我的朋友

分类: 系统运维

2008-04-19 15:08:00

UTF-8编码的详细讲解(8)

ISO 2022 标准指定了一系列的 ESC % 序列, 以离开 ISO 2022 世界 (指定其他的编码系统, DOCS), 用于 UTF-8 的许多这样的序列已经注册进了 ISO 2375 International Register of Coded Character Sets:  

ESC %G 从 ISO 2022 里激活一个未指定实现级别的 UTF-8 模式且允许再返回 ISO 2022.  
ESC %@ 从 UTF-8 回到 ISO 2022, 条件是通过 ESC %G 进入的 UTF-8  
ESC %/G 切换进 UTF-8 级别 1 且不返回.  
ESC %/H 切换进 UTF-8 级别 2 且不返回.  
ESC %/I 切换进 UTF-8 级别 3 且不返回.  
当一个终端模拟器在 UTF-8 模式时, 任何 ISO 2022 逃脱码序列例如用于切换 G2/G3 等的都被忽略. 一个在 UTF-8 模式下的终端模拟器唯一会执行的 ISO 2022 序列是 ESC %@ 以从 UTF-8 返回 ISO 2022 方案. 

UTF-8 仍然允许你使用象 CSI 这样的 C1 控制字符, 尽管 UTF-8 也使用 0x80-0x9F 范围里的字节. 重要的是必须理解在 UTF-8 模式下的终端模拟器必须在执行任何控制字符前对收到的字节流运用 UTF-8 解码器. C1 字符与其他任何大于 U+007F 的字符一样需先经过 UTF-8 解码. 

已经有哪些支持 UTF-8 的应用程序了? 
Yudit 是 Gaspar Sinai 的自由 X11 Unicode 编辑器  
Mined 98 由 Thomas Wolff 提供, 是一个可以处理 UTF-8 的文本编辑器.  
less 版本 346 或更高, 支持 UTF-8  
C-Kermit 7.0 在传输, 终端, 及文件字符集方面支持 UTF-8.  
Sam 是 Plan9 的 UTF-8 编辑器, 类似于 vi, 也可用于 Linux 和 Win32. (Plan9 是第一个完全转向 UTF-8, 将其作为字符编码的操作系统.)  
9term 由 Matty Farrow 提供, 是一个 Plan9 操作系统的 Unicode/UTF-8 终端模拟器的 Unix 移植.  
Wily 是一个 Plan9 Acme 编辑器的 Unix 实现.  
ucm-0.1 是 Juliusz Chroboczek 的 Unicode 字符映射表, 一个小工具, 使你可以选中任何一个 Unicode 字符并粘贴进你的应用程序.  
有哪些用于改善 UTF-8 支持的补丁? 
Robert Brady 提供了一个 patch for less 340 (现在已经合并进了 less 344)  
Bruno Haible 提供了用于 stty, Linux 核心 tty 等的 多个补丁.  
Otfried Cheong 编写了 Unicode encoding for GNU Emacs 工具箱, 使 Mule 能够处理 UTF-8 文件.  
Postscript 字形的名字与 UCS 代码是怎么关联的? 
参考 Adobe 的 Unicode and Glyph Names 指南.  

X11 的剪切与粘贴工作在 UTF-8 时是如何完成的? 
参考 Juliusz Chroboczek 的 客户机间 Unicode 文本的交换 草案, 对 ICCCM 的一个扩充的建议, 用一个新的可用于属性类型(property type)和选中(selection)目标的原子 UTF8_STRING 来处理 UTF-8 的选中. 

现在有没有用于处理 Unicode 的免费的库? 
IBM Classes for Unicode  
Mark Leisher 的 UCData Unicode 字符属性库和 wchar_t 支持测试码.  
各种 X widget 对 Unicode 支持的现状如何? 
GScript - Unicode 与复杂文本处理 是一个为 GTK+ 增加全功能的 Unicode 支持的项目.  
Qt 2.0 现在支持使用 *-ISO10646-1 字体了.  
FriBidi 是 Dov Grobgeld 的 Unicode 双向算法的免费实现.  
有什么关于这个话题的好的邮件列表? 
你确实应该订阅的是  邮件列表, 这是发现标准的作者和其他许多领袖的话语的最好办法. 订阅方法是, 用 "subscribe" 作为标题, "subscribe ESS unicode" 作为正文, 发一条消息到 . 

也有一个专注与改进通常用于 GNU/Linux 系统上应用程序的 UTF-8 支持的邮件列表 . 订阅方法是, 以 "subscribe linux-utf8" 为内容, 发送消息到 . 你也可以浏览 linux-utf8 archive 

其他相关的还有 XFree86 组的 "字体" 与 "i18n" 列表, 但你必须成为一名正式的开发者才能订阅. 

更多参考 
Bruno Haible ’s Unicode HOWTO.  
The Unicode Standard, Version 2.0  
Unicode Technical Reports  
Mark Davis’ Unicode FAQ  
ISO/IEC 10646-1:1993  
Frank Tang’s I?t?rnati?nàliz?ti?n Secrets  
Unicode Support in the Solaris 7 Operating Environment  
The USENIX paper by Rob Pike and Ken Thompson on the introduction of UTF-8 under Plan9 reports about the first operating system that migrated already in 1992 completely to UTF-8 (which was at the time still called UTF-2).  
Li18nux is a project initiated by several Linux distributors to enhance Unicode support for Linux.  
The Online Single Unix Specification contains definitions of all the ISO C Amendment 1 function, plus extensions such as wcwidth().  
The Open Group’s summary of ISO C Amendment 1.  
GNU libc  
The Linux Console Tools  
The Unicode Consortium character database and character set conversion tables are an essential resource for anyone developping Unicode related tools.  
Other conversion tables are available from Microsoft and Keld Simonsen’s WG15 archive.  
Michael Everson’s ISO10646-1 archive contains online versions of many of the more recent ISO 10646-1 amendments, plus many other goodies. See also his Roadmaps to the Universal Character Set.  
An introduction into The Universal Character Set (UCS).  
Otfried Cheong’s essey on Han Unification in Unicode  
The AMS STIX project is working on revising and extending the mathematical characters for Unicode 4.0 and ISO 10646-2.  
Jukka Korpela’s Soft hyphen (SHY) - a hard problem? is an excellent discussion of the controversy surrounding U+00AD.  
James Briggs’ Perl, Unicode and I18N FAQ.  
我不断地将新的材料加入这份文档, 因此请定期来查看. 欢迎所有关于改进的建议, 以及自由软件社区里关于改善 UTF-8 支持的广告. UTF-8 用在 Linux 里是新近的事, 因此我们在将来的几个月里可以见到大量的进展. 

特别感谢 Ulrich Drepper 和 Bruno Haible 的有价值的注解
阅读(1271) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~