Unicode compatibility characters
In Unicode and the UCS, a compatibility character is a character that is encoded solely to maintain round-trip convertibility with other, often older, standards. As the Unicode Glossary says:
A character that would not have been encoded except for compatibility and round-trip convertibility with other standards
Although compatibility is used in names, it is not marked as a property. However, the definition is more complicated than the glossary reveals. One of the properties given to characters by the Unicode consortium is the characters' decomposition or compatibility decomposition. Over five thousand characters do have a compatibility decomposition mapping that compatibility character to one or more other UCS characters. By setting a character's decomposition property, Unicode establishes that character as a compatibility character. The reasons for these compatibility designations are varied and are discussed in further detail below. The term decomposition sometimes confuses because a character's decomposition can, in some cases, be a singleton. In these cases the decomposition of one character is simply another approximately equivalent character.
Compatibility character types and keywords
The compatibility decomposition property for the 5,402 Unicode compatibility characters includes a keyword that divides the compatibility characters into 17 logical groups. Those characters with a compatibility decomposition but without a keyword are termed canonical decomposable characters and those characters are not compatibility characters. Keywords for compatibility decomposable characters include: <initial>, <medial>, <final>, <isolated>, <wide>, <narrow>, <small>, <square>, <vertical>, <circle>, <noBreak>, <fraction>, <sub>, <super>, and <compat>. These keywords provide some indication of the relation between the compatibility character and its compatibility decomposition character sequence. Compatibility characters fall in three basic categories:- Characters corresponding to multiple alternate glyph forms and precomposed diacritics to support software and font implementations that do not include complete Unicode text layout capabilities.
- Characters included from other character sets or otherwise added to the UCS that constitute rich text rather than the plain text goals of Unicode.
- Some other characters that are semantically distinct, but visually similar.
Compatibility mappings types
Glyph substitution and composition
Some compatibility characters are completely dispensable for text processing and display software that conforms to the Unicode standard. These include:;Ligatures: Ligatures such as 'ffi' in the Latin script were often encoded as a separate character in legacy character sets. Unicode's approach to ligatures is to treat them as rich text and, if turned on, handled through glyph substitution.
;Precomposed Roman numerals: For example, Roman numeral twelve can be decomposed into a Roman numeral ten and two Roman numeral ones.
;Precomposed fractions: These decomposition have the keyword <fraction>. A fully conforming text handler should display the vulgar fraction ¼ identically to the composed fraction 1⁄4.
;Contextual glyphs or forms: These arise primarily in the Arabic script. Using fonts with glyph substitution capabilities such as OpenType and TrueTypeGX, Unicode conforming software can substitute the proper glyphs for the same character depending on whether that character appears at the beginning, end, middle of a word or in isolation. Such glyph substitution is also necessary for vertical text layout for some East Asian languages. In this case glyphs must be substituted or synthesized for wide, narrow, small and square glyph forms. Non-conforming software or software using other character sets instead use multiple separate character for the same letter depending on its position: further complicating text processing.
The UCS, Unicode character properties and the Unicode algorithms provide software implementations with everything needed to properly display these characters from their decomposition equivalents. Therefore, these decomposable compatibility characters become redundant and unnecessary. Their existence in the character set requires extra text processing to ensure text is properly compared and collated. Moreover, these compatibility characters provide no additional or distinct semantics. Nor do these characters provide any visually distinct rendering provided the text layout and fonts are Unicode conforming. Also, none of these characters are required for round-trip convertibility to other character sets, since the transliteration can easily map decomposed characters to precomposed counterparts in another character set. Similarly, contextual forms, such as a final Arabic letter can be mapped based on its position within a word to the appropriate legacy character set form character.
In order to dispense with these compatibility characters, text software must conform to several Unicode protocols. The software must be able to:
- Compose diacritic marked graphemes from letter characters and one or more separate combining diacritic marks.
- Substitute ligatures and contextual glyph variants.
- Layout CJKV text vertically, substituting glyphs for small, vertical, narrow, wide square forms, either from font data or synthesized as needed.
- Combine fractions using the 'Fraction Slash' character and any other arbitrary characters.
- Combine a 'Combining Long Solidus Overlay' with other symbols: for example ∄ or ∄ for ∄.
Rich text compatibility characters
Many other compatibility characters constitute what Unicode considers rich text and therefore outside the goals of Unicode and UCS. In some sense even compatibility characters discussed in the previous section—those that aid legacy software in displaying ligatures and vertical text—constitute a form of rich text, since the rich text protocols determine whether text is displayed in one way or another. However, the choice to display text with or without ligatures or vertically versus horizontally are both non-semantic rich text. They are simply style differences. This is in contrast to other rich text such as italics, superscripts and subscripts, or list markers where the styling of the rich text implies certain semantics along with it.For comparing, collating, handling and storing plain text, rich text variants are semantically redundant. For example, using a superscript character for the numeral 4 is likely indistinguishable from using the standard character for a numeral 4 and then using rich text protocols to make it superscript. Such alternate rich text characters therefore create ambiguity because they appear visually the same as their plain text counterpart characters with rich text formatting applied. These rich text compatibility characters include:
;Mathematical Alphanumeric Symbols: These symbols are simply clones of the Latin and Greek alphabets and Indic-Arabic decimal digits repeated in 15 various typefaces. They are intended as an arbitrary palette for mathematical notation. However, they tend to undermine the distinction between encoding characters versus encoding visual glyphs as well as Unicode's goals of supporting only plain text characters. Such alternate styling for a mathematical symbol palette could be easily created through rich text protocols instead.
;Enclosed Alphanumerics and ideographs : These are characters included primarily for list markers. They do not constitute plain text characters. Moreover, the use of other rich text protocols is more appropriate since, the set of enclosed alphanumerics or ideographs provisioned in the UCS is limited.
;Circled alphanumerics and ideographs: The circled forms are also likely for use as markers. Again, using characters along with rich text protocols to encircle characters strings is more flexible.
;Spaces and no-break spaces of varying widths: These characters are simply rich text variants of the core space and No-break Space. Other rich text protocols should be used instead such as tracking, kerning or word-spacing attributes.
;Some subscript and superscript form characters: Many of the subscript and superscript characters are actually semantically distinct characters from the International Phonetic Alphabet and other writing systems and do not really fall in the category of rich text. However, others simply constitute rich text presentation forms of other Greek, Latin and numeral characters. These rich text superscript and subscript characters therefore properly belong to this category of rich text compatibility characters. Most of these are in the "Superscripts and Subscripts" or the "Basic Latin" blocks.
For all of these rich text compatibility characters the display of glyphs is typically distinct from their compatibility decomposition characters. However, these are considered compatibility characters and discouraged for use by the Unicode consortium because they are not plain text characters, which is what Unicode seeks to support with its UCS and associated protocols. Rich text should be handled through non-Unicode protocols such as HTML, CSS, RTF and other such protocols.
The rich text compatibility characters comprise 1,451 of the 5,402 compatibility characters. These include all of the compatibility characters marked with keywords <circle> and <font> ; 11 spaces variants from the <compat> and canonical characters; and some of the keyword <superscript> and <subscript> from the "Superscripts and Subscripts" block.
Semantically distinct characters
Many compatibility characters are semantically distinct characters, though they may share representational glyphs with other characters. Some of these characters may have been included because most other characters sets that focused on one script or writing system. So for example, the ISO and other Latin character sets likely included a character for π since, when focusing on primarily one writing system or script, those character sets would not have otherwise had characters for the common mathematical symbol π;. However, with Unicode, mathematicians are free to use characters from any known script in the World to stand in for a mathematical set or mathematical constant. To date, Unicode has only added specific semantic support for a few such mathematical constants. Therefore, Unicode designates several mathematical symbols based on letters from Greek and Hebrew as compatibility characters. These include:- Hebrew letter based symbols : alef, bet, gimel and dalet
- Greek letter based symbols : beta, theta, phi, pi, kappa, rho, capital theta
Though not the intention of Unicode to encode such measuring units the repertoire includes six such symbols that should not be used by authors: the characters' decompositions should be used instead.
Unicode also designates twenty-two other letter-like symbols as compatibility characters.
- Other Greek letter-based symbols : lunate epsilon, lunate sigma, capital lunate sigma, upsilon with hook
- Mathematical constants : Euler constant, Planck constant, reduced Planck constant,
- Currency symbols : rupee sign, rial sign
- Punctuation : one dot leader, no-break space, non-breaking hyphen, Tibetan mark delimiter tsheg bstar
- Other letter-like symbols : information source, account of, addressed to the subject, care of, cada una, numero, telephone sign, facsimile sign, trademark, service mark
- 112 characters representing abstract phonemes from phonetic alphabets such as the International Phonetic Alphabet use such positional glyphs to represent semantic differences
- 14 characters from the Kanbun block
- 1 character from the Tifinagh script: Tifinagh Modifier Letter Labialization Mark
- 1 character from the Georgian script: Modifier Letter Georgian Nar
- masculine and feminine ordinal indicators included in the Latin-1 supplement block
- Capital Roman Numerals : One, Five, Ten, Fifty, One Hundred, Five Hundred, One Thousand
- and lower case variants : One, Five, Ten, Fifty, One Hundred, Five Hundred and One Thousand
- 18 precomposed Roman numerals in uppercase and lowercase variants
The presence of these 167 semantically distinct though visually similar characters among the decomposable characters complicates the topic of compatibility characters. The Unicode standard discourages the use of compatibility characters by content authors. However, in certain specialized areas, these characters are important and quite similar to other characters that have not been included among the compatibility characters. For example, in certain academic circles the use of Roman numerals as distinct from Latin letters that share the same glyphs would be no different from the use of Cuneiform numerals or ancient Greek numerals. Collapsing the Roman numeral characters to Latin letter characters eliminates a semantic distinction. A similar situation exists for phonetic alphabet characters that use subscript or superscript positioned glyphs. In the specialized circles that use phonetic alphabets, authors should be able to do so without resorting to rich text protocols. As another example the keyword 'circle' compatibility characters are often used for describing the game Go. However, these uses of the compatibility characters constitute exceptions where the author has a special reason to use the otherwise discouraged characters.
Compatibility blocks
Several blocks of Unicode characters include either entirely or almost entirely all compatibility characters. The compatibility blocks contain none of the semantically distinct compatibility characters with only one exception: the rial currency symbol so the compatibility decomposable characters in the compatibility blocks fall unambiguously into the set of discouraged characters. Unicode recommends authors use the plain text compatibility decomposition equivalents instead and complement those characters with rich text markup. This approach is much more flexible and open-ended than using the finite set of circled or enclosed alphanumerics to give just one example.Unfortunately, there are a small number of characters even within the compatibility blocks that themselves are not compatibility characters and therefore may confuse authors. The "Enclosed CJK Letters and Months" block contains a single non-compatibility character: the 'Korean Standard Symbol'. That symbol and 12 other characters have been included in the blocks for unknown reasons. The "CJK Compatibility Ideographs" block contains these non-compatibility unified Han ideographs:
- : 﨎
- : 﨏
- : 﨑
- : 﨓
- : 﨔
- : 﨟
- : 﨡
- : 﨣
- : 﨤
- : 﨧
- : 﨨
- : 﨩
Several other characters in these blocks have no compatibility mapping but are clearly intended for legacy support:
Alphabetic Presentation Forms
- Hebrew Point Judeo-Spanish Varika : ﬞ. This is a glyph variant of Hebrew Point Rafe : ֿ, though Unicode provides no compatibility mapping.
- "Ornate Left Parenthesis" '
- "Ornate Right Parenthesis" : ﴿. A glyph variant for U+0028 ': ﷽. Bismillah Ar-Rahman Ar-Raheem is a ligature for Beh, Seen, Meem, Space, Alef, Lam, Lam, Heh, Space, Alef, Lam, Reh, Hah, Meem, Alef, Noon, Space, Alef, Lam, Reh, Hah, Yeh, Meem i.e.
- "Arabic Tail Fragment" : ﹳ for supporting text systems without contextual glyph handling
- Sesame Dot : ﹅
- White Sesame Dot : ﹆
- 10 Negative Circled Numbers : ⓫ – ⓴
- 11 Double Circled Numbers : ⓵ – ⓾
Normalization