轉載須注明出處:簡書@Orca_J35
以下內容直接翻譯自 Unicode 術語表:Glossary of Unicode Terms
Unicode 是一種用數(shù)值表示字符的標準,適用于世界上所有的語言,它為不同語言提供了存儲、搜索和替換文本的統(tǒng)一方法。Unicode 作為一種標準,其中包含了用于可視化參考的編碼圖表(code charts)、一組標準字符編碼、一組編碼方案、一組參考數(shù)據(jù)文件以及許多相關項目。我們在網(wǎng)絡上看到的很多資料會將 Unicode 僅視作一個字符集,這種理解是不正確的。
Unicode 轉換格式 (Unicode Transformation Format):是 Unicode encoding form 或 Unicode encoding scheme 的模糊同義詞,優(yōu)先使用后兩者。
Unicode 簽名 (Unicode Signature):是一個隱式標記,用于將文件標識為包含特定"編碼模式"的 Unicode 文本。初始化字節(jié)順序標記(BOM)可用作 Unicode 簽名。
Unicode 字符串 (Unicode String):一個"編碼單元序列 ",其中包含了特定 Unicode "編碼模式"下的"編碼單元"。(See definition D80 in Section 3.9, Unicode Encoding Forms.)
Unicode 字符數(shù)據(jù)庫 (Unicode Character Database):有關 Unicode 字符屬性和映射關系的規(guī)范及詳細信息的一組文件。
編碼空間 (Codespace):(1) 可用于編碼字符的數(shù)值范圍。(2) 對于 Unicode 標準,編碼空間的范圍是 0x0 ~ 0x10FFFF。(See definition D9 inSection 3.4, Characters and Encoding.)
字素 (Grapheme):在特定書寫系統(tǒng)的背景下,最低限度的獨特寫作單位。示例:在英文書寫系統(tǒng)中 ?b? 和 ?d? 是不同的字素,因為它們會形成不同的單詞,如 big 和 dig。但是,小寫拉丁字母 a 和小寫羅馬字母 a 并沒有明顯區(qū)別,因為在這兩種不同形式的基礎上不能區(qū)分出不同的單詞。 (2) 用戶認為的字符
渲染 (Rendering). (1) 為了描繪字符,而選擇并布局字形的過程。(2) 在顯示設備上顯示字形的過程。
傳輸編碼語法 (Transfer Encoding Syntax):應用于文本和其它數(shù)據(jù)的可逆轉換,數(shù)據(jù)需要經(jīng)過轉換后才允許被傳輸,例如 Base64 和 uuencode。
字形
字形 (glyph):(1)表示一個或多個"字形圖形"的抽象形式。(2)與字形圖像(glyph image)同義。在顯示 Unicode 字符數(shù)據(jù)時,可以選擇一個至多個字形來描繪特定字符。在合成(composition )和布局(layout)處理期間,會通過渲染引擎選擇這些字形。(See also character.)
字形代碼 (Glyph Code):用于引用字形的數(shù)字代碼。通常會通過字形代碼來引用字體(font)中包含的字形。字形代碼可以是特定字體的本地代碼;也就是說,包含相同字形的不同字體可以使用不同的代碼。
字形標識符 (Glyph Identifier):與字形代碼類似,字形標識符是用于引用字體內字形的標簽。字體可以采用本地和全局字形標識符。
字形圖像 (Glyph Image):已經(jīng)點陣化(rasterized)或以其它方式成像到某些顯示表面的字形表示的具體圖像。The actual, concrete image of a glyph representation having been rasterized or otherwise imaged onto some display surface.
字體 (Font):字形的集合,用于字符數(shù)據(jù)的可視化描述。字體通常會關聯(lián)一組參數(shù)[例如,size, posture, weight, serifness],在為參數(shù)設置特定值后,便會生成一個圖像化(imagable)的字形集合。
字符
字符 (Character):(1)在書面語言中具備語義價值的最小組成部分,泛指抽象的意義和[或]形狀(shape),而非特定的形狀 (see also glyph);然而在編碼表(code tables)中,為了便于讀者理解,呈現(xiàn)某種形式的視覺表示是必不可少的。(2)抽象字符的同義詞。(3)Unicode 字符編碼的基本單元。(4) The English name for the ideographic written elements of Chinese origin. [See ideograph (2).]
抽象字符(Abstract Character):用于組織、控制或表示文本數(shù)據(jù)的信息單元。(See definition D7 in Section 3.4, Characters and Encoding.)。
- 抽象字符沒有具體形式,不應與字形(glyph)混淆
- 抽象字符不一定與用戶認為的“字符”相對應,不應與字素( grapheme )混淆。例如,可能只是字素的一部分,比如一個漢字的部首。
抽象字符序列 (Abstract Character Sequence):一個或多個抽象字符的有序序列(See definition D8 in Section Section 3.4, Characters and Encoding.)
字符集 (Character Set):用于表示文本信息的元素的集合(collection)??蓪⒆址斫鉃榫幋a字符集,至少包含了碼點和抽象字符。
字符倉庫 (Character Repertoire):一個字符集(Character Set)中所包含的字符集合(collection)。
編碼字符
已編碼字符 (Encoded Character):抽象字符(abstract character)和碼點(code point)之間的關聯(lián)(或映射)[See definition D11 in Section 3.4, Characters and Encoding.]。抽象字符本身沒有數(shù)值值,但"encoding a character"的步驟會將特定的碼點與特定的抽象字符關聯(lián)。
An encoded character is also referred to as a coded character.
雖然"已編碼字符"在術語中的正式定義是,抽象字符和碼點之間的映射;但非正式地來講,"已編碼字符"可被認為是與為其分配的碼點一起使用的抽象字符。
有時,為了與其他標準兼容,單個抽象字符可能會對應多個碼點,比如 "?" 擁有兩個對應的碼點: U+00C5 和 U+212B。
-
單個字符也可由一系列碼點表示,比如 "?" 也可被表示為碼點序列:U+0041 U+030A,而不再是被映射到單個碼點。
[圖片上傳失敗...(image-b08788-1538236458630)]
已編碼字符序列 (Coded Character Sequence):一個或多個碼點構成的有序序列。通常,由一系列編碼字符組成,但也可能包含非字符(noncharacters)或保留(reserved)碼點。(See definition D12 in Section 3.4, Characters and Encoding.) 另外,Coded Character Representation 與 coded character sequence 同義
已編碼字符集(coded character set):是一個字符集,其中的每個字符都分配有數(shù)值碼點,或說每個字符都擁有各自的碼點。通常會簡寫為字符集(character set)、charset、編碼集(code set)。A character set in which each character is assigned a numeric code point.
碼點
碼點(code point):(1) Unicode 編碼空間(codespace)中的任意值,也就是說可以是 0 ~ 0x10FFFF 中的任意值。(See definition D10 in Section 3.4, Characters and Encoding.) 不是所有碼點都會被分配給已編碼字符。(2) 指已編碼字符集中某個字符的值或位置。
在 Unicode 標準中,碼點采用 16 進制書寫,并加上前綴 U+ (例如,拉丁字母 A 的碼點是 U+0041 )。Unicode 的碼點可以分成 17 個代碼級別(code plane):
第一個代碼級別被稱為基本多語言級別(basic multilingual plane - BMP),碼點從 U+0000 到 U+FFFF,其中包括經(jīng)典的 Unicode 代碼;
-
其余的 16 個級別碼點從 U+10000 到 U+10FFFF,其中包括一些輔助字符(Supplementary character)
tips: 可參考 Code point planes and blocks 可獲取更詳細的解釋
碼點類型 (Code Point Type):Unicode 標準中將碼點分為 7 種基礎類型:Graphic, Format, Control, Private-Use, Surrogate, Noncharacter, Reserved. (See definition D10a in Section 3.4, Characters and Encoding.)
保留碼點(Reserved Code Point):Unicode 標準中留作將來使用的碼點,也稱為未分配碼點(unassigned code point)
已指定碼點 (Designated Code Point):任何已分配給抽象字符 [assigned characters ] 或已通過標準賦予了規(guī)定功能的碼點[ surrogate code points and noncharacters ]。該定義排除了保留的代碼點。Designated Code Point 與 assigned code point 同義。(See Section 2.4 Code Points and Characters.)
未分配字符(Unassigned Character):未分配給抽象字符的碼點,包含代理(surrogate)碼點、非字符(noncharacters)以及保留碼點。 (See Section 2.4, Code Points and Characters.)
已分配字符 (Assigned Character):已被分配給抽象字符的碼點,是指在 Unicode 標準中已編碼的字符——graphic, format, control, and private-use characters。(See Section 2.4, Code Points and Characters.)
標量值
Unicode 標量值 (Scalar Value):除開高代理碼點(high-surrogate)和低代理碼點(low-surrogat )之外的任何 Unicode 碼點都是標量值,具體范圍是 0x0 ~ 0xD7FF 和 0xE000 ~ 0x10FFFF。代理碼點不能通過"編碼模式"映射為"編碼單元序列",只有標量值可被映射為"編碼單元序列"。(See definition D76 in Section 3.9, Unicode Encoding Forms.)
代理
代理字符 (Surrogate Character):錯誤用詞,它是指具有代理碼點的已編碼字符,不要使用該術語。
代理碼點 (Surrogate Code Point):位于 U+D800 ~ U+DFFF 之間的 Unicode 碼點屬于作代理碼點,保留共 UTF-16 使用。UTF-16 使用一對代理編碼單元"表示"輔助碼點。
代理對 (Surrogate Pair):用于表示單個抽象字符,由包含兩個 16-bit 編碼單元的序列構成。代理對中的第一個值被稱作高代理(high-surrogate)編碼單元,第二個值被稱作低代理(low--surrogate)編碼單元。(See definition D75 in Section 3.8, Surrogates.)
高代理碼點 (High-Surrogate Code Point):位于 U+D800 ~ U+DBFF 間的 Unicode 碼點屬于高代理碼點。(See definition D71 in Section 3.8, Surrogates.)
高代理編碼單元 (High-Surrogate Code Unit):位于 0xD800 ~ 0xDBFF 間的 16-bit 編碼單元,在 UTF-16 中被用作代理對的第一個編碼單元。(See definition D72 in Section 3.8, Surrogates.)
低代理碼點 (Low-Surrogate Code Point):位于 U+DC00 ~ U+DFFF 間的 Unicode 碼點屬于低代理碼點。(See definition D73 in Section 3.8, Surrogates.)
低代理編碼單元 (Low-Surrogate Code Unit):位于 0xDC00~ 0xDFFF 間的 16-bit 編碼單元,在 UTF-16 中被用作代理對的第二個編碼單元。(See definition D74 in Section 3.8, Surrogates.)
編碼單元
編碼單元(code unit):也稱編碼值(Code Value),表示用于處理或交換編碼文本的基本單元。Unicode 標準在 UTF-8 編碼模式中使用 8-bit 編碼單元;在 UTF-16 編碼模式中使用 16-bit 編碼單元;在 UTF-32 編碼模式中使用 32-bit 編碼單元。
編碼模式
Unicode 編碼模式 (Unicode Encoding Form):一組字符編碼模式,用于為每個 Unicode 標量值(scalar value)分配一個唯一的"編碼單元序列"。Unicode 標準定義了三種 Unicode 編碼模式:UTF-8, UTF-16, and UTF-32。(See definition D79 in Section 3.9, Unicode Encoding Forms.)
字符編碼模式 (Character Encoding Form):簡稱編碼模式,將字符集中的定義(definition)映射到表示數(shù)據(jù)的實際編碼單元。另外,Encoding Form 與 character encoding form 同義
編碼方案
Unicode 編碼方案 (Encoding Scheme):是指擁有特定字節(jié)序列的 Unicode 編碼模式。如果允許的話,會包含字節(jié)順序標記(byte order mark - BOM)。(See definition D94 in Section 3.10, Unicode Encoding Schemes.)
字符編碼方案 (Character Encoding Scheme):字符編碼模式加上字節(jié)序列。Unicode 中有 7 中編碼方案:UTF-8, UTF-16, UTF-16BE, UTF-16LE, UTF-32, UTF-32BE, UTF-32LE。另外,Encoding Scheme 與 character encoding scheme 同義
字節(jié)序列
字節(jié)序列 (Byte Serialization):The order of a series of bytes determined by a computer architecture.
字節(jié)序列標記 (byte order mark - BOM):Unicode 字符 U+FEFF 用于表示文本的字節(jié)順序(See Section 2.13, Special Characters and Noncharacters, and Section 23.8, Specials.)
Little-endian :A computer architecture that stores multiple-byte numerical values with the least significant byte (LSB) values first. 低字節(jié)優(yōu)先,小端模式
Big-endian. A computer architecture that stores multiple-byte numerical values with the most significant byte (MSB) values first. 高字節(jié)優(yōu)先,大端模式
UTF
轉換格式 (Transformation Format):從已編碼字符序列到唯一編碼序列的映射(typically bytes)。
UTF :Unicode (or UCS) Transformation Format 的縮寫。
UTF-2 :UTF-8 的曾用名,現(xiàn)已廢棄。
UTF-7 :Unicode (or UCS) Transformation Format, 7-bit 編碼模式,由 RFC-2152 詳細定義。
UTF-8
UTF-8 :用于文本的多字節(jié)編碼,會使用 1 ~ 4 個字節(jié)來表示任意 Unicode 字符,并且向后兼容 ASCII。網(wǎng)頁中的 Unicode 以 UTF-8 為主。
UTF-8 編碼模式 (Encoding Form):一種 Unicode 編碼模式,會為每個 Unicode 標量值分配一個唯一的無符號字節(jié)序列,該序列的長度是 1 ~ 4 字節(jié)。下表展示了 UTF-8 中比特位編碼方式: (See definition D92 in Section 3.9, Unicode Encoding Forms.)
| Scalar Value | First Byte | Second Byte | Third Byte | Fourth Byte |
|---|---|---|---|---|
| 00000000 0xxxxxxx | 0xxxxxxx | |||
| 00000yyy yyxxxxxx | 110yyyyy | 10xxxxxx | ||
| zzzzyyyy yyxxxxxx | 1110zzzz | 10yyyyyy | 10xxxxxx | |
| 000uuuuu zzzzyyyy yyxxxxxx | 11110uuu | 10uuzzzz | 10yyyyyy | 10xxxxxx |
UTF-8 編碼方案 (Encoding Scheme):一種 Unicode 編碼方案,使用與 UTF-8 "編碼單元序列"自身完全相同的順序來序列化"編碼單元序列"。(See definition D95 in Section 3.10, Unicode Encoding Schemes.)The Unicode encoding scheme that serializes a UTF-8 code unit sequence in exactly the same order as the code unit sequence itself.
UTF-16
UTF-16 :用于文本的多字節(jié)編碼,會使用 2 或 4 個字節(jié)來表示任意 Unicode 字符,不向后兼容 ASCII 。UTF-16 是許多編程語言中 Unicode 的內部模式,如 Java、C#、JavaScript 以及許多操作系統(tǒng)。
UTF-16 編碼模式 (Encoding Form):一種 Unicode 編碼模式,會為 U+0000..U+D7FF 和 U+E000..U+FFFF 中的每個 Unicode 標量值分配一個唯一的無符號 16-bit 編碼單元(編碼單元的值與 Unicode 標量值相等);會為 U+10000..U+10FFFF 中的每個 Unicode 標量值分配一個唯一代理對。下表展示了 UTF-16 中比特位編碼方式: (See definition D91 in Section 3.9, Unicode Encoding Forms.)
| Scalar Value | UTF-16 |
|---|---|
| xxxxxxx xxxxxxxxx | xxxxxxxx xxxxxxxx |
| 000uuuuu xxxxxxxx xxxxxxxx | 110110wwwwxxxxxx 110111xxxxxxxxxx |
UTF-16 編碼方案 (Encoding Scheme):該編碼方案會將 UTF-16 "編碼單元序列"序列化為 big-endian 或 little-endian 格式的字節(jié)序列。(See definition D98 in Section 3.10, Unicode Encoding Schemes.)
UTF-16BE :一種 Unicode 編碼方案,會將 UTF-16 "編碼單元序列"序列化為 big-endian 格式的字節(jié)序列。(See definition D96 in Section 3.10, Unicode Encoding Schemes.)
UTF-16LE :一種 Unicode 編碼方案,會將 UTF-16 "編碼單元序列"序列化為 little-endian 格式的字節(jié)序列。(See definition D96 in Section 3.10, Unicode Encoding Schemes.)
UTF-32
UTF-32 :用于文本的多字節(jié)編碼,會使用 4 個字節(jié)來表示任意 Unicode 字符;不向后兼容 ASCII 。
UTF-32 編碼模式 (Encoding Form):一種 Unicode 編碼模式,會為每個 Unicode 標量值分配一個唯一的無符號 32-bit 編碼單元(編碼單元的值與 Unicode 標量值相等)。(See definition D90 in Section 3.9, Unicode Encoding Forms.)
UTF-32 編碼方案 (Encoding Scheme):該 Unicode 編碼方案會將 UTF-32 "編碼單元序列" 序列化為 big-endian 或 little-endian 格式的字節(jié)序列。(See definition D101 in Section 3.10, Unicode Encoding Schemes.)
UTF-32BE :一種 Unicode 編碼方案,會將 UTF-32 "編碼單元序列"序列化為 big-endian 格式的字節(jié)序列。(See definition D99 in Section 3.10, Unicode Encoding Schemes.)
UTF-32LE :一種 Unicode 編碼方案,會將 UTF-32 "編碼單元序列"序列化為 little-endian 格式的字節(jié)序列。 (See definition D100 in Section 3.10, Unicode Encoding Schemes.)
UCS
UCS - Universal Character Set 通用字符集,由 International Standard ISO/IEC 10646 所規(guī)定,與 Unicode 標準相同。
UCS-2 :ISO/IEC 10646 編碼模式,使用兩個 8 位編碼通用字符集,僅限于基本多語言平面,不能編碼輔助平面。
UCS-4 :ISO/IEC 10646 編碼模式:使用 4 個 8 位編碼通用字符集,適用于所有平面。