Content deleted Content added
m →Interlinear annotation: fix misguided link |
|||
(23 intermediate revisions by 13 users not shown) | |||
Line 1:
{{short description|Non-printing format effectors and control codes included in Unicode}}
Many
In the narrowest sense, a ''control code'' is a character with the [[Unicode character property#General Category|general category]] {{code|Cc}}, which comprises the [[C0 and C1 control codes]], a concept defined in [[ISO/IEC 2022]] and inherited by Unicode, with the most common set being defined in [[ISO/IEC 6429]]. Control codes are handled distinctly from ordinary Unicode characters, for example, by not being assigned character names (although they are assigned normative formal aliases).<ref name="aliases">{{cite web |url=https://www.unicode.org/Public/UCD/latest/ucd/NameAliases.txt |title=Name Aliases |work=Unicode Character Database |institution=[[Unicode Consortium]]}}</ref> In a broader sense, other non-printing format characters, such as those used in [[bidirectional text]], are also referred to as ''control characters'' by software;<ref name="segan">{{cite web |url=http://kvota.net/guadec/localised-desktop-talk/ |title=Towards a localised desktop |quotation=For some cases where automatic decision making doesn't work, you can manually add specific direction markers by right-clicking the text field, choosing "Insert Unicode control character" from the menu, and selecting appropriate direction mark. This would allow you, for instance, to start your RTL text with an otherwise LTR word (such as "GNOME"). |first=Danilo |last=Segan}}</ref> these are mostly assigned to the general category {{code|Cf}} (format), used for format effectors introduced and defined by Unicode itself.
Line 8:
The control code ranges 0x00–0x1F ("C0") and 0x7F originate from the 1967 edition of [[US-ASCII]]. The standard [[ISO/IEC 2022]] (ECMA-35) defines extension methods for ASCII, including a secondary "C1" range of 8-bit control codes from 0x80 to 0x9F, equivalent to 7-bit sequences of {{ctrl|ESC}} with the bytes 0x40 through 0x5F. Collectively, codes in these ranges are known as the [[C0 and C1 control codes]]. Although ISO/IEC 2022 allows for the existence of multiple control code sets specifying differing interpretations of these control codes, their most common interpretation is specified in [[ISO/IEC 6429]] (ECMA-48).
The [[ISO/IEC 8859]] series of encodings conforms to [[ISO/IEC 4873]] (ECMA-43) level 1, a subset of ISO/IEC 2022 designed for 8-bit character encodings, and therefore
Category "Cc" control codes can serve a variety of purposes, not limited to format effectors: for example, the default ASCII C0 set includes six format effectors ({{ctrl|BS}}, {{ctrl|HT}}, {{ctrl|LF}}, {{ctrl|VT}}, {{ctrl|FF}} and {{ctrl|CR}}), ten transmission controls, four device controls, four information separators and eight other control codes.<ref name="ir001">{{
* {{
* {{
* {{
* {{
* {{
* {{
Unicode only specifies semantics for {{tt|U+0009—U+000D}}, {{tt|U+001C—U+001F}}, and {{tt|U+0085}} (the ASCII format effectors except for {{ctrl|BS}}, plus the ASCII information separators and the C1 {{ctrl|NEL}}). The rest of the "Cc" control codes are transparent to Unicode and their meanings are left to higher-level protocols, although interpretation as defined in ISO/IEC 6429 is suggested as a default.<ref name="unicode-23-1">{{cite
== Unicode introduced separators ==
In an attempt to simplify the several [[newline]] characters used in legacy text{{citation needed|date=November 2014}}, Unicode introduces its own newline characters to separate either lines or paragraphs: {{unichar|2028|line separator
Like CR and LF, LS and PS are effectors for text formatting; unlike CR and LF, they are not treated as "control codes" for [[ECMA-35]]/[[ECMA-48]] purposes (category {{code|Cc}}), rather having semantics defined entirely by Unicode itself. They are assigned to ''[[sui generis]]'' [[Unicode character property#General Category|Unicode categories]] {{code|Zl}} and {{code|Zp}} respectively, under the major category {{code|Z}} (separator) used for certain [[whitespace character]]s.
Line 26:
== Language tags ==
{{main|Tags (Unicode block)}}
Unicode
These language tag characters would not be displayed themselves. However, they would provide information for text processing or even for the display of other characters. For example, the display of Unihan ideographs might have substituted different glyphs if the language tags indicated Korean than if the tags indicated Japanese. Another example, might have influenced the display of decimal digits 0 through 9 differently depending on the language they appeared in.
The tag characters
Unicode states that "the use of tag characters to represent language tags in a plain text stream is still a deprecated mechanism for conveying language information about text.<ref name="migration" />
== Interlinear annotation ==
Three formatting characters provide support for [[
== Bidirectional text control ==
{{main|
Unicode supports standard bidirectional text without any special characters. In other words Unicode conforming software should display right-to-left characters such as Hebrew letters as right-to-left simply from the properties of those characters. Similarly, Unicode handles the mixture of left-to-right-text alongside right-to-left text without any special characters. For example, one can quote Arabic (“بسم الله”) (translated into English as "Bismillah") right alongside English and the Arabic letters will flow from right-to-left and the Latin letters left-to-right.
However, directionality may not be detected correctly if left-to-right text is quoted at the beginning of a right-to-left paragraph (or ''vice versa''),<ref name="segan"/> and the support for bidirectional text becomes even more complicated when text flowing in opposite directions is embedded hierarchically, for example if an English text quotes an Arabic phrase that in turn quotes an English phrase. Other situations may also complicate this, such as when an author wants the left-to-right characters overridden so that they flow from right-to-left. While these situations are fairly rare, Unicode provides twelve characters
* {{unichar|061C|ARABIC LETTER MARK}}
* {{unichar|200E|LEFT-TO-RIGHT MARK}}
* {{unichar|200F|RIGHT-TO-LEFT MARK}}
* {{unichar|202A|LEFT-TO-RIGHT EMBEDDING}}
* {{unichar|202B|RIGHT-TO-LEFT EMBEDDING}}
* {{unichar|202C|POP DIRECTIONAL FORMATTING}}
* {{unichar|202D|LEFT-TO-RIGHT OVERRIDE}}
* {{unichar|202E|RIGHT-TO-LEFT OVERRIDE}}
* {{unichar|2066|LEFT-TO-RIGHT ISOLATE}}
* {{unichar|2067|RIGHT-TO-LEFT ISOLATE}}
* {{unichar|2068|FIRST STRONG ISOLATE}}
* {{unichar|2069|POP DIRECTIONAL ISOLATE}}
== Variation selectors ==
Line 67 ⟶ 76:
{{unicode navigation}}
[[Category:Unicode special code points|Control characters]]
|