C0 and C1 control codes#STX
{{short description|Control characters, ranging from U+0000 to U+001F (C0) and U+0080 to U+009F (C1) in Unicode}}
{{Redirect|DC1}}
{{redirect|Group separator|the delimiter used to group digits in large numbers|Decimal separator#Digit grouping}}
The C0 and C1 control code or control character sets define control codes for use in text by computer systems that use ASCII and derivatives of ASCII. The codes represent additional information about the text, such as the position of a cursor, an instruction to start a new line, or a message that the text has been received.
C0 codes are the range 00HEX–1FHEX and the default C0 set was originally defined in ISO 646 (ASCII). C1 codes are the range 80HEX–9FHEX and the default C1 set was originally defined in ECMA-48 (harmonized later with ISO 6429). The ISO/IEC 2022 system of specifying control and graphic characters allows other C0 and C1 sets to be available for specialized applications, but they are rarely used.
{{anchor|C0}}C0 controls
ASCII defines 32 control characters, plus the DEL character. This large number of codes was desirable at the time, as multi-byte controls would require implementation of a state machine in the terminal, which was very difficult with contemporary electronics and mechanical terminals.
Only a few codes have maintained their use: BEL, ESC, and the format effector{{cite standard|title=Standard ECMA-6 7-bit Coded Character Set|year=1965|url=https://www.ecma-international.org/wp-content/uploads/ECMA-6_5th_edition_march_1985.pdf|page=4}} (FEn) characters BS, TAB, LF, VT, FF, and CR. Others are unused or have acquired different meanings such as NUL being the C string terminator. Some data transfer protocols such as ANPA-1312, Kermit, and XMODEM do make extensive use of SOH, STX, ETX, EOT, ACK, NAK and SYN for purposes approximating their original definitions; and some file formats use the "Information Separators" (ISn) such as the Unix info format{{cite web |url=https://www2.pd.infn.it/TeX/doc/html/texinfo/info_2.html#SEC13 |title=Adding a new node to Info |work=Info: The online, menu-driven GNU documentation system |last=Fox |first=Brian |author-link=Brian Fox (computer programmer) |publisher=GNU Project}} and Python's {{tt|splitlines}} string method.{{cite web |url=https://docs.python.org/3/library/stdtypes.html#str.splitlines |title=Built-in Types § str.splitlines |work=The Python Standard Library |publisher=Python Software Foundation}}
The names of some codes were changed in ISO 6429:1992 (or ECMA-48:1991) to be neutral with respect to writing direction. The abbreviations used were not changed, as the standard had already specified that those would remain unchanged when the standard is translated to other languages. In this table both new and old names are shown for the renamed controls (the old name is the one matching the abbreviation).
Unicode provides Control Pictures that can replace C0 control characters to make them visible on screen. However caret notation is used more often.
{{anchor|ASCII}}
class="wikitable"
|+ ASCII control codes, originally defined in ANSI X3.4.{{cite iso-ir |sponsor=ISO/TC 97/SC 2 |sponsor-link=ISO/IEC JTC 1/SC 2#History |title=The set of control characters of the ISO 646 |date=1975 |number=1}} ! {{vert header|Caret notation}} ! {{vert header|Decimal}} ! {{vert header|Hexadecimal}} ! Abbreviations ! {{vert header|Control Pictures}} ! Name ! {{vert header|C escape}} ! Description | ||||||
id="NUL"
|{{tt|^@}} | 0 | 00 | NUL | ␀ | Null | {{tt|\0}}
| Does nothing. The code of blank paper tape, and also used for padding to slow transmission. |
id="SOH"
|{{tt|^A}} | 1 | 01 | TC1, SOH | ␁ | Start of Heading | | First character of the heading of a message.{{citation|mode=cs1 |url=https://www.iptc.org/std/IPTC7901/1.0/specification/7901V5.pdf |title=The IPTC Recommended Message Format |id=IPTC TEC 7901 |edition=5th |date=1995 |author=IPTC |author-link=IPTC}} |
id="STX"
|{{tt|^B}} | 2 | 02 | TC2, STX | ␂ | Start of Text | | Terminates the header and starts the message text. |
id="ETX"
|{{tt|^C}} | 3 | 03 | TC3, ETX | ␃ | End of Text | | Ends the message text, starts a footer (up to the next TC character). |
id="EOT"
|{{tt|^D}} | 4 | 04 | TC4, EOT | ␄ | End of Transmission | | Ends the transmission of one or more messages.{{cite web |url=http://www.its.bldrdoc.gov/fs-1037/dir-014/_2015.htm |title=end-of-transmission character (EOT) |work=Federal Standard 1037C |year=1996 |archive-url=https://web.archive.org/web/20160309030543/http://www.its.bldrdoc.gov/fs-1037/dir-014/_2015.htm |archive-date=2016-03-09 |url-status=dead}} May place terminals on standby. |
id="ENQ"
|{{tt|^E}} | 5 | 05 | {{nowrap|TC5, ENQ, WRU{{efn|Teletype labelled the key WRU for 'who are you?'}}}} | ␅ | Enquiry | | Trigger a response at the receiving end, to see if it is still present. |
id="ACK"
|{{tt|^F}} | 6 | 06 | TC6, ACK | ␆ | Acknowledge | | Indication of successful receipt of a message. |
id="BEL"
|{{tt|^G}} | 7 | 07 | BEL{{efn|The name BELL is assigned by Unicode to the unrelated emoji character 🔔 (U+1F514). While C0 and C1 control characters were not formally named by the Unicode standard itself at the time, this collided with existing use of BELL as the name of this control character in software following the previous versions of UTS#18 (the Unicode Regular Expressions standard),{{cite web | title=Re: PRI #202: Extensions to NameAliases.txt for Unicode 6.1.0 | url=http://unicode.org/mail-arch/unicode-ml/y2011-m08/0459.html | last=Williamson | first=Karl}} e.g. in Perl. Unicode now accepts ALERT and BEL (but not BELL) as formal aliases for the control character, although the code chart still lists BELL as the ISO 6429 alias,{{cite web | url=https://www.unicode.org/charts/PDF/U0000.pdf | title=C0 Controls and Basic Latin | publisher=Unicode Consortium}} and the corresponding control picture code point is called SYMBOL FOR BELL. Perl subsequently switched to using BELL for the emoji in version 5.18.{{cite web | url=https://perldoc.perl.org/charnames.html | title=charnames | work=Perl Programming Documentation}}}} | ␇ | Bell, Alert | {{tt|\a}}
|Call for attention from an operator. |
id="BS"
|{{tt|^H}} | 8 | 08 | {{anchor|format effector}}FE0, BS | ␈ | Backspace | {{tt|\b}}
|Move one position leftwards. Next character may overprint or replace the character that was there. |
id="HT"
|{{tt|^I}} | 9 | 09 | FE1, HT | ␉ | Character Tabulation, Horizontal Tabulation | {{tt|\t}}
|Move right to the next tab stop. |
id="LF"
|{{tt|^J}} | 10 | 0A | FE2, LF | ␊ | Line Feed | {{tt|\n}}
|Move down to the same position on the next line (some devices also moved to the left column). |
id="VT"
|{{tt|^K}} | 11 | 0B | FE3, VT | ␋ | Line Tabulation, Vertical Tabulation | {{tt|\v}}
|Move down to the next vertical tab stop. |
id="FF"
|{{tt|^L}} | 12 | 0C | FE4, FF | ␌ | Form Feed | {{tt|\f}}
|Move down to the top of the next page. |
id="CR"
|{{tt|^M}} | 13 | 0D | FE5, CR | ␍ | Carriage Return | {{tt|\r}}
|Move to column zero while staying on the same line. |
id="SO"
|{{tt|^N}} | 14 | 0E | SO, LS1{{efn|name="lockingshifts"|ISO/IEC 2022 (ECMA-35) refers to these as LS0 and LS1 in 8-bit environments, and as SI and SO in 7-bit environments.{{cite book |id=ECMA-35 |title=Character Code Structure and Extension Techniques |edition=6th |type=ECMA Standard |date=1994 |author=ECMA |author-link=Ecma International |url=https://www.ecma-international.org/wp-content/uploads/ECMA-35_6th_edition_december_1994.pdf#page=24 |page=14 |section=7.3: Invocation of character-set code elements}}}} | ␎ | Shift Out | |Switch to an alternative character set. |
id="SI"
|{{tt|^O}} | 15 | 0F | SI, LS0{{efn|name="lockingshifts"}} | ␏ | Shift In | |Return to regular character set after SO. |
id="DLE"
|{{tt|^P}} | 16 | 10 | {{nowrap|TC7, DC0,{{efn|The first, 1963 edition of ASCII classified {{control code link|internal=1|DLE}} as a device control, rather than a transmission control, and gave it the abbreviation DC0 ("device control reserved for data link escape").{{citation|mode=cs1 |url=https://www.sr-ix.com/Archive/CharCodeHist/X3.4-1963/page6.JPG |id=ASA X3.4-1963 |date=1963 |author=American Standards Association |author-link=American National Standards Institute |title=American Standard Code for Information Interchange: 4. Legend |page=6}}}} DLE}} | ␐ | Data Link Escape | | Cause a limited number of contiguously following characters to be interpreted in some different way.{{cite web |url=https://www.its.bldrdoc.gov/fs-1037/dir-010/_1429.htm |title=data link escape character (DLE) |work=Federal Standard 1037C |year=1996 |archive-url=https://web.archive.org/web/20160801021749/http://www.its.bldrdoc.gov/fs-1037/dir-010/_1429.htm |archive-date=2016-08-01 |url-status=dead}}{{cite web |url=http://ecma-international.org/publications-and-standards/standards/ecma-37/ |title=Supplementary transmission control functions (an extension of the basic mode control procedures for data communication systems) |id=ECMA-37 |institution=European Computer Manufacturers Association |year=1972}} |
id="DC1"{{anchor|Device control}}
|{{tt|^Q}} | 17 | 11 | DC1, XON | ␑ | Device Control One | | rowspan="4" |Turn on (DC1 and DC2) or off (DC3 and DC4) devices.
Teletype{{cite web |author1=Robert McConnell |author2=James Haynes |author3=Richard Warren |url=https://www.nadcomm.com/index3fbb.html?p=89 |title=Understanding ASCII Codes |website=NADCOMM |date=December 2002}} used these for the paper tape reader and the paper tape punch. The first use became the de facto standard for software flow control.{{cite web |title=What is the point of Ctrl-S? |url=https://unix.stackexchange.com/questions/137842/what-is-the-point-of-ctrl-s |website=Unix and Linux Stack exchange |access-date=14 February 2019}} |
id="DC2"
|{{tt|^R}} | 18 | 12 | DC2, TAPE | ␒ | Device Control Two | |
id="DC3"
|{{tt|^S}} | 19 | 13 | DC3, XOFF | ␓ | Device Control Three | |
id="DC4"
|{{tt|^T}} | 20 | 14 | DC4, | ␔ | Device Control Four | |
id="NAK"
|{{tt|^U}} | 21 | 15 | TC8, NAK | ␕ | Negative Acknowledge | | Negative response to a sender, such as a detected error. |
id="SYN"
|{{tt|^V}} | 22 | 16 | TC9, SYN | ␖ | Synchronous Idle | | Sent in synchronous transmission systems when no other character is being transmitted. |
id="ETB"
|{{tt|^W}} | 23 | 17 | TC10, ETB | ␗ | {{nowrap|End of Transmission Block}} | | End of a transmission block of data when data are divided into such blocks for transmission purposes. |
id="CAN"
|{{tt|^X}} | 24 | 18 | CAN | ␘ | Cancel | | Indicates that the data preceding it are in error or are to be disregarded. |
id="EM"
|{{tt|^Y}} | 25 | 19 | EM | ␙ | End of medium | | Indicates on paper or magnetic tapes that the end of the usable portion of the tape had been reached. |
id="SUB"
|{{tt|^Z}} | 26 | 1A | SUB | ␚ | Substitute | | Replaces a character that was found to be invalid or in error. Should be ignored. |
id="ESC"
|{{tt|^[}} | 27 | 1B | ESC | ␛ | Escape
| style="text-align:center" | {{tt|\e}} | Alters the meaning of a limited number of following bytes. | |
id="FS"
|{{tt|^\}} | 28 | 1C | IS4, FS {{anchor|Field separators}} | ␜ | File Separator | |rowspan="4"|Can be used as delimiters to mark fields of data structures. US is the lowest level, while RS, GS, and FS are of increasing level to divide groups made up of items of the level beneath it. SP (space) could be considered an even lower level. |
id="GS"
|{{tt|^]}} | 29 | 1D | IS3, GS | ␝ | Group Separator | |
id="RS"
|{{tt|^^}} | 30 | 1E | IS2, RS | ␞ | Record Separator | |
id="US"
|{{tt|^_}} | 31 | 1F | IS1, US | ␟ | Unit Separator | |
colspan=10|While not technically part of the C0 control character range, the following two characters can be thought of as having some characteristics of control characters. | ||||||
---|---|---|---|---|---|---|
id="SP"
| | 32 | 20 | SP | ␠ | Space | | Move right one character position. |
id="DEL"
|{{tt|^?}} | 127 | 7F | DEL | ␡ | Delete | | Should be ignored. Used to delete characters on punched tape by punching out all the holes. |
{{notelist}}
{{anchor|C1}}C1 controls
In 1973, ECMA-35 and ISO 2022{{citation|mode=cs1 |url=https://www.ecma-international.org/wp-content/uploads/ECMA-6_4th_edition_august_1973.pdf |title=7-bit Input/Output Coded Character Set |author=ECMA/TC 1 |author-link=Ecma International |publisher=ECMA |date=1973 |section=Brief History |edition=4th |id=ECMA-6:1973}} attempted to define a method so an 8-bit "extended ASCII" code could be converted to a corresponding 7-bit code, and vice versa. In a 7-bit environment, the Shift Out ({{control code link|internal=1|SO}}) would change the meaning of the 96 bytes {{tt|0x20}} through {{tt|0x7F}}{{efn|In early versions the range excluded {{tt|SP}} and {{tt|DEL}}{{citation|mode=cs1 |url=https://www.ecma-international.org/wp-content/uploads/ECMA-6_4th_edition_august_1973.pdf#page=21 |title=7-bit Input/Output Coded Character Set |author=ECMA/TC 1 |author-link=Ecma International |publisher=ECMA |date=1973 |page=16 |section=4.2: Specific Control Characters |edition=4th |id=ECMA-6:1973}}}}{{citation|mode=cs1 |url=https://www.ecma-international.org/wp-content/uploads/ECMA-35_4th_edition_march_1985.pdf |title=Code Extension Techniques |author=ECMA/TC 1 |author-link=Ecma International |publisher=ECMA |date=1985 |pages=17–18 |section=5.3.8: Sets of 96 graphic characters |edition=4th |id=ECMA-35:1985}} (i.e. all but the C0 control codes), to be the characters that an 8-bit environment would print if it used the same code with the high bit set. This meant that the range {{tt|0x80}} through {{tt|0x9F}} could not be printed in a 7-bit environment,{{citation|mode=cs1 |url=https://www.ecma-international.org/wp-content/uploads/ECMA-35_1st_edition_december_1971.pdf |title=Extension of the 7-bit Coded Character Set |author=ECMA/TC 1 |author-link=Ecma International |publisher=ECMA |date=1971 |pages=21–24 |section=8.2: Correspondence between the 7-bit Code and an 8-bit Code |edition=1st |id=ECMA-35:1971}} thus it was decided that no alternative character set could use them, and that these codes should be additional control codes, which become known as the C1 control codes. To allow a 7-bit environment to use these new controls, the sequences ESC @
through ESC _
were to be considered equivalent. The later ISO 8859 standards abandoned support for 7-bit codes, but preserved this range of control characters.
The first C1 control code set to be registered for use with ISO 2022 was DIN 31626, a specialised set for bibliographic use which was registered in 1979.
The more common general-use ISO/IEC 6429 set was registered in 1983, although the ECMA-48 specification upon which it was based had been first published in 1976{{citation|mode=cs1 |url=https://www.ecma-international.org/wp-content/uploads/ECMA-48_2nd_edition_august_1979.pdf |title=Additional Control Functions for Character-Imaging I/O Devices |id=ECMA-48:1979 |date=1979 |section=Brief History |edition=2nd |author=ECMA/TC 1 |author-link=Ecma International |publisher=ECMA}} and JIS X 0211 (formerly JIS C 6323).{{cite web |url=http://fujimura2.fiw-web.net/java/lang/JIS02XX.html |title=JIS X 02xx 符号 |language=ja}} Symbolic names defined by {{IETF RFC|1345}} and early drafts of ISO 10646, but not in ISO/IEC 6429 ({{control code link|internal=1|PAD}}, {{control code link|internal=1|HOP}} and {{control code link|internal=1|SGC}}) are also used.
Except for {{control code link|internal=1|SS2}} and {{control code link|internal=1|SS3}} in EUC-JP text, and {{control code link|internal=1|NEL}} in text transcoded from EBCDIC, the 8-bit forms of these codes were almost never used. {{control code link|internal=1|CSI}}, {{control code link|internal=1|DCS}} and {{control code link|internal=1|OSC}} are used to control text terminals and terminal emulators, but almost always by using their 7-bit escape code representations. Nowadays if these codes are encountered it is far more likely they are intended to be printing characters from that position of Windows-1252 or Mac OS Roman.
Except for {{control code link|internal=1|NEL}}, Unicode does not provide a "control picture" for any of these. There is no well-known variation of Caret notation for them either.
class="wikitable"
|+ ISO/IEC 6429 and RFC 1345 C1 control codes ! {{vert header|ESC+}} ! {{vert header|Decimal}} ! {{vert header|Hex}} ! Abbr !title="Character name"| Name | Description{{cite book |url=https://www.ecma-international.org/wp-content/uploads/ECMA-48_5th_edition_june_1991.pdf |title=Control Functions for Coded Character Sets |id=ECMA-48:1991 |date=June 1991 |edition=5th |author=ECMA/TC 1 |author-link=Ecma International |publisher=ECMA}} | ||||
id="PAD"
|@ | 128 | 80 | PAD | Padding Character{{efn|name=notpart|Not part of ISO/IEC 6429 (ECMA-48){{cite web|author=Ken Whistler|url=https://www.unicode.org/L2/L2011/11281-control-aliases.txt|title=Formal Name Aliases for Control Characters, L2/11-281|publisher=Unicode Consortium|date=July 20, 2011}}{{cite web | url=http://unicode.org/mail-arch/unicode-ml/y2015-m10/0050.html | title=Why Nothing Ever Goes Away | work=Unicode Mailing List | date=2015-10-05 | author=Ken Whistler}}{{cite book |url=https://genorma.com/en/standards/iso-6429-1983 |title=ISO 6429:1983 Information processing — ISO 7-bit and 8-bit coded character sets — Additional control functions for character-imaging devices |date=1983-05-01 |publisher=ISO}}{{rp|page=4}}{{cite book |url=https://genorma.com/en/standards/iso-6429-1988 |title=ISO 6429:1988 Information processing — Control functions for 7-bit and 8-bit coded character sets |date=1988-11-15 |publisher=ISO}}{{rp|page=5}}{{cite ISO standard |csnumber=12782 |title=ISO/IEC 6429:1992 Information technology — Control functions for coded character sets |date=1992-12-15 |publisher=ISO |access-date=2024-05-29}}{{rp|page=8}} }}
|Proposed as a "padding" or "high byte" for single-byte characters to make them two bytes long for easier interoperability with multiple byte characters. Extended Unix Code (EUC) occasionally uses this.{{cite book | url=https://books.google.com/books?id=EH1MDAAAQBAJ&q=%22euc+format%22&pg=PA244 | title=CJKV Information Processing: Chinese, Japanese, Korean, and Vietnamese Computing | publisher=O'Reilly | author=Lunde, Ken | year=2008 | isbn=9780596800925 | page=244}} | |
id="HOP"
|A | 129 | 81 | HOP | High Octet Preset{{efn|name=notpart}} | Proposed to set the high byte of a sequence of multiple byte characters so they only need one byte each, as a simple form of data compression. |
id="BPH"
|B | 130 | 82 | BPH | Break Permitted Here{{efn|name=notfirst|Not part of the first edition of ISO/IEC 6429.{{cite iso-ir |number=77 |title=C1 Control Set of ISO 6429:1983 |date=1983-10-01 |sponsor=ISO/TC97/SC2 |sponsor-link=ISO/IEC JTC 1/SC 2#History}}{{rp|page=4}}}} | Follows a graphic character where a line break is permitted. Roughly equivalent to a soft hyphen or zero-width space except it does not define what is printed at the line break. |
id="NBH"
|C | 131 | 83 | NBH | No Break Here{{efn|name=notfirst}} | Follows the graphic character that is not to be broken. See also word joiner. |
id="IND"
|D | 132 | 84 | IND | Index{{efn|Deprecated in 1988 and withdrawn in 1992 from ISO/IEC 6429{{rp|page=87}} (1986{{cite book |url=https://ecma-international.org/wp-content/uploads/ECMA-48_4th_edition_december_1986.pdf |title=Control Functions for Coded Character Sets |id=ECMA-48:1986 |date=December 1986 |section=Appendix E: Changes Made in this Edition |edition=4th |author=ECMA/TC 1 |author-link=Ecma International |publisher=ECMA}} and 1991{{cite book |url=https://www.ecma-international.org/wp-content/uploads/ECMA-48_5th_edition_june_1991.pdf |title=Control Functions for Coded Character Sets |id=ECMA-48:1991 |date=June 1991 |section=F.8 Eliminated control functions |edition=5th |author=ECMA/TC 1 |author-link=Ecma International |publisher=ECMA}} respectively for ECMA-48).}} | Move down one line without moving horizontally, to eliminate ambiguity about the meaning of LF. |
id="NEL"
|E | 133 | 85 | NEL | Next Line | Equivalent to CR+LF, to match the EBCDIC control character. |
id="SSA"
|F | 134 | 86 | SSA | Start of Selected Area | rowspan=2|Used by block-oriented terminals. In xterm {{code|ESC F}} moves to the lower-left corner of the screen, since certain software assumes this behaviour.{{cite web |url=https://invisible-island.net/xterm/manpage/xterm.html#VT100-Widget-Resources:hpLowerleftBugCompat |title=VT100 Widget Resources (§ hpLowerleftBugCompat) |work=xterm - terminal emulator for X}} |
id="ESA"
|G | 135 | 87 | ESA | End of Selected Area | |
id="HTS"
|H | 136 | 88 | HTS | {{ubl|Character Tabulation Set|Horizontal Tabulation Set}} | Set a tab stop at the current position. |
id="HTJ"
|I | 137 | 89 | HTJ | {{ubl|{{nowrap|Character Tabulation With Justification}}|{{nowrap|Horizontal Tabulation With Justification}}}}
|Right-justify the text since the last tab against the next tab stop. | |
id="VTS"
|J | 138 | 8A | VTS | {{ubl|Line Tabulation Set|Vertical Tabulation Set}} | Set a vertical tab stop. |
id="PLD"
|K | 139 | 8B | PLD | {{ubl|Partial Line Forward|Partial Line Down}} | rowspan="2"| To produce subscripts and superscripts in ISO/IEC 6429. Subscripts use PLD text PLU while superscripts use PLU text PLD . |
id="PLU"
|L | 140 | 8C | PLU | {{ubl|Partial Line Backward|Partial Line Up}} | |
id="RI"
|M | 141 | 8D | RI | {{ubl|Reverse Line Feed|Reverse Index}} | Move up one line. |
id="SS2"
|N | 142 | 8E | SS2 | {{Control code link|SS2|Single-Shift 2}} | rowspan="2"|Next character is from the G2 or G3 sets, respectively. |
id="SS3"
|O | 143 | 8F | SS3 | {{Control code link|SS3|Single-Shift 3}} | |
id="DCS"
|P | 144 | 90 | DCS | Device Control String | Followed by a string of printable characters (0x20 through 0x7E) and format effectors (0x08 through 0x0D), terminated by ST (0x9C). Xterm defined a number of these.{{cite web |url=https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Device-Control-functions |title=Device-Control functions |work=XTerm Control Sequences |last1=Moy |first1=Edward |last2=Gildea |first2=Stephen |last3=Dickey |first3=Thomas}} |
id="PU1"
|Q | 145 | 91 | PU1 | Private Use 1 | rowspan=2|Reserved for private function agreed on between the sender and the recipient of the data. |
id="PU2"
|R | 146 | 92 | PU2 | Private Use 2 | |
id="STS"
|S | 147 | 93 | STS | Set Transmit State | |
id="CCH"
|T | 148 | 94 | CCH | Cancel character | Destructive backspace, to eliminate ambiguity about meaning of {{Control code link|internal=1|BS}}. |
id="MW"
|U | 149 | 95 | MW | Message Waiting | |
id="SPA"
|V | 150 | 96 | SPA | Start of Protected Area | rowspan=2|Used by block-oriented terminals. |
id="EPA"
|W | 151 | 97 | EPA | End of Protected Area | |
id="SOS"
|X | 152 | 98 | SOS | Start of String{{efn|name=notfirst}} | Followed by a control string terminated by {{Control code link|internal=1|ST}} (0x9C) which (unlike {{Control code link|internal=1|DCS}}, {{Control code link|internal=1|OSC}}, {{Control code link|internal=1|PM}} or {{Control code link|internal=1|APC}}) may contain any character except SOS or ST. |
id="SGC"
|Y | 153 | 99 | SGC,{{cite web |url=https://www.unicode.org/Public/UCD/latest/ucd/NameAliases.txt |title=Name Aliases |work=Unicode Character Database |institution=Unicode Consortium}} SGCI{{cite web |url=http://archive.adaic.com/pol-hist/history/9x-history/reports/charset-Oct89.txt |title=Ada 9x Project Report: Character Set Issues for Ada 9x |year=1989 |first=Ronald F. |last=Brender |publisher=Carnegie Mellon University}} | Single Graphic Character Introducer{{efn|name=notpart}}
|{{anchor|SGCI}}Intended to allow an arbitrary Unicode character to be printed; it would be followed by that character, most likely encoded in UTF-1. | |
id="SCI"
|Z | 154 | 9A | SCI | Single Character Introducer{{efn|name=notfirst}} | To be followed by a single printable character (0x20 through 0x7E) or format effector (0x08 through 0x0D), and to print it as ASCII no matter what graphic or control sets were in use. |
id="CSI"
| | 155 | 9B | CSI | Control Sequence Introducer | Used to introduce control sequences that take parameters. Used for ANSI escape sequences. |
id="ST"
|\ | 156 | 9C | ST | String Terminator | Terminates a string started by {{Control code link|internal=1|DCS}}, {{Control code link|internal=1|SOS}}, {{Control code link|internal=1|OSC}}, {{Control code link|internal=1|PM}} or {{Control code link|internal=1|APC}}. |
id="OSC"
|] | 157 | 9D | OSC | Operating System Command | rowspan=3|Followed by a string of printable characters (0x20 through 0x7E) and format effectors (0x08 through 0x0D), terminated by ST (0x9C), intended for use to allow in-band signaling of protocol information, but rarely used for that purpose.
Some terminal emulators, including xterm, use OSC sequences for setting the window title and changing the colour palette. They may also support terminating an OSC sequence with {{Control code link|internal=1|BEL}} instead of ST.{{cite web |url=https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands |title=Operating System Commands |work=XTerm Control Sequences |last1=Moy |first1=Edward |last2=Gildea |first2=Stephen |last3=Dickey |first3=Thomas}} Kermit used APC to transmit commands.{{cite book|author1=Frank da Cruz|author2=Christine Gianone|title=Using C-Kermit|url=https://books.google.com/books?id=QuYQPc-c67MC&pg=PA278|year=1997|publisher=Digital Press|isbn=978-1-55558-164-0|page=278}} |
id="PM"
|^ | 158 | 9E | PM | Privacy Message | |
id="APC"
|_ | 159 | 9F | APC | Application Program Command |
{{notelist}}
Other control code sets
The ISO/IEC 2022 (ECMA-35) extension mechanism allowed escape sequences to change the C0 and C1 sets. The standard C0 control character set shown above is chosen with the sequence {{nowrap|{{code|ESC ! @}}}} and the above C1 set chosen with the sequence {{nowrap|{{code|ESC " C}}}}.
Several official and unofficial alternatives have been defined, but this is pretty much obsolete. Most were forced to retain a good deal of compatibility with the ASCII controls for interoperability. The standard makes ESC,{{cite iso-ir |number=104 |sponsor1=ISO/TC97/SC2/WG-7 |sponsor-link1=ISO/IEC JTC 1/SC 2#History |sponsor2=ECMA |sponsor-link2=Ecma International |title=Minimum C0 set for ISO 4873 |date=1985-08-01}} SP and DEL{{efn|ISO/IEC 4873 extends this requirement to the C1 SS2 and SS3,{{refn|{{cite iso-ir |number=105 |title=Minimum C1 Set for ISO 4873 |date=1985-08-01 |sponsor1=ISO/TC97/SC2/WG-7 |sponsor-link1=ISO/IEC JTC 1/SC 2#History |sponsor2=ECMA |sponsor-link2=Ecma International}}}} although ISO/IEC 2022 itself does not.}} "fixed" coded characters, which are available in their ASCII locations in all encodings that conform to the standard.{{cite book |id=ECMA-35 |title=Character Code Structure and Extension Techniques |edition=6th |type=ECMA Standard |date=1994 |author=ECMA |author-link=Ecma International |url=https://www.ecma-international.org/wp-content/uploads/ECMA-35_6th_edition_december_1994.pdf#page=17 |page=7 |section=6.2: Fixed coded characters}} It also specifies that if a C0 set included transmission control (TCn) codes, they must be encoded at their ASCII locations{{cite book |id=ECMA-35 |title=Character Code Structure and Extension Techniques |edition=6th |type=ECMA Standard |date=1994 |author=ECMA |author-link=Ecma International |url=https://www.ecma-international.org/wp-content/uploads/ECMA-35_6th_edition_december_1994.pdf#page=21 |page=11 |section=6.4.2: Primary sets of coded control functions}} and could not be put in a C1 set,{{cite book |id=ECMA-35 |title=Character Code Structure and Extension Techniques |edition=6th |type=ECMA Standard |date=1994 |author=ECMA |author-link=Ecma International |url=https://www.ecma-international.org/wp-content/uploads/ECMA-35_6th_edition_december_1994.pdf#page=21 |page=11 |section=6.4.3: Supplementary sets of coded control functions}} and any new transmission controls must be in a C1 set.
= Other C0 control code sets =
- ANPA-1312, a text markup language used for news transmission, replaces several C0 control characters.
- IPTC 7901, the newer international version of the above, has its own variations.
- Videotex has a completely different set.
- Teletext also defines a set similar to Videotex.
- T.61/T.51,{{cite iso-ir |sponsor=ITU |sponsor-link=ITU |title=Teletex Primary Set of Control Functions |date=1985 |number=106}} and others{{cite iso-ir |sponsor=Úřad pro normalizaci a měřeni |title=The set of control characters of ISO 646, with EM replaced by SS2 |date=1987 |number=140}} replaced EM and GS with SS2 and SS3 so these functions could be used in a 7-bit environment without resorting to escape sequences.
- Some sets replaced FS with SS2,{{cite iso-ir |sponsor=ISO/TC 97/SC 2 |sponsor-link=ISO/IEC JTC 1/SC 2#History |title=The set of control characters of ISO 646, with IS4 replaced by Single Shift for G2 (SS2) |date=1977 |number=36}} (same as ANPA-1312).
- {{anchor|JIS C 6225|JIS X 0207}}The now-withdrawn JIS C 6225, designated JIS X 0207 in later sources.{{cite web |url=http://original-jpeg.org/Document%20archive/wg8/wg8n0604.pdf |id=ISO/TC97/SC2/WG6 N317.rev |title=Liaison statement to ISO/TC97/SC2/WG8 and ISO/TC97/SC18/WG8 |author=ISO/TC97/SC2/WG6 |author-link=ISO/IEC JTC 1/SC 2#History |archive-url=https://web.archive.org/web/20201026055422/http://original-jpeg.org/Document%20archive/wg8/wg8n0604.pdf |archive-date=2020-10-26 |url-status=dead}} replaced FS with CEX or "Control Extension"{{cite iso-ir |sponsor=ISO/TC 97/SC 2 |sponsor-link=ISO/IEC JTC 1/SC 2#History |title=The C0 set of Control Characters of Japanese Standard JIS C 6225-1979 |date=1982 |number=74}} which introduces control sequences for vertical text behaviour, superscripts and subscripts{{citation|mode=cs1 |url=http://printronix.com/wp-content/uploads/manuals/PTX_PRM_OKI_N7_256482A.pdf#page=26 |title=OKI® Programmer's Reference Manual |page=26 |author=Printronix |year=2012}} and for transmitting custom character graphics.
= Replacement C1 character sets =
- A specialized C1 control code set is registered for bibliographic use (including string collation), such as by MARC-8.{{cite iso-ir |number=40 |title=Additional Control Codes for Bibliographic Use according to German Standard DIN 31626 |date=1979-07-15 |sponsor=DIN |sponsor-link=DIN}}{{cite iso-ir |number=67 |title=Additional Control Codes for Bibliographic Use according to International Standard ISO 6630 |date=1983-06-01 |sponsor=ISO/TC 46}}{{cite iso-ir |number=124 |title=Additional Control Codes for Bibliographic Use according to International Standard ISO 6630 |date=1986-02-01 |sponsor=ISO/TC 46}}
- Various specialised C1 control code sets are registered for use by Videotex formats.
- EBCDIC defines up to 29 additional control codes besides those present in ASCII. When translating EBCDIC to Unicode (or to ISO 8859), these codes are mapped to C1 control characters in a manner specified by IBM's Character Data Representation Architecture (CDRA).{{cite web |url=https://www.unicode.org/reports/tr16/tr16-6.html#Step%202 |title=3.3 Step 2: Byte Conversion |work=UTF-EBCDIC |id=Unicode Technical Report #16 |last1=Umamaheswaran |first1=V.S. |publisher=Unicode Consortium |date=1999-11-08 |quotation=The 64 control characters […], the ASCII DELETE character (U+007F)[…] are mapped respecting EBCDIC conventions, as defined in IBM Character Data Representation Architecture, CDRA, with one exception -- the pairing of EBCDIC Line Feed and New Line control characters are swapped from their CDRA default pairings to ISO/IEC 6429 Line Feed (U+000A) and Next Line (U+0085) control characters}}{{citation|mode=cs1 |url=https://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/EBCDIC/CP037.TXT |title=cp037_IBMUSCanada to Unicode table |last1=Steele |first1=Shawn |publisher=Microsoft/Unicode Consortium |date=1996-04-24}} Although the New Line (NL) does translate to the ISO/IEC 6429 {{Control code link|internal=1|NEL}} (although it is often swapped with LF, following UNIX line ending convention), the remainder of the control codes do not correspond. For example, the EBCDIC control {{Control code link|SPS}} and the ECMA-48 control {{Control code link|internal=1|PLU}} are both used to begin a superscript or end a subscript, but are not mapped to one another. Extended-ASCII-mapped EBCDIC can therefore be regarded as having its own C1 set, although it is not registered with the ISO-IR registry for ISO/IEC 2022.{{citation|title=ISO/IEC International Register of Coded Character Sets To Be Used With Escape Sequences |id=ISO-IR |publisher=ITSCJ/IPSJ |url=https://itscj.ipsj.or.jp/english/vbcqpr00000004qn-att/ISO-IR.pdf}}
Unicode
{{main|Unicode control characters}}
Unicode reserves the 65 code points described above for compatibility with the C0 and C1 control codes, giving them the general category {{code|Cc}} (control). These are:
- {{tt|U+0000–U+001F}} (C0 controls) and {{tt|U+007F}} (DEL) assigned to the C0 Controls and Basic Latin block, and
- {{tt|U+0080–U+009F}} (C1 controls) assigned to the C1 Controls and Latin-1 Supplement block.
Unicode only specifies semantics for the C0 format controls HT, LF, VT, FF, and CR (note BS is missing); the C0 information separators FS, GS, RS, US (and SP); and the C1 control NEL. The rest of the codes are transparent to Unicode and their meanings are left to higher-level protocols, with ISO/IEC 6429 suggested as a default.{{cite book |chapter-url=https://www.unicode.org/versions/Unicode15.0.0/ch23.pdf#page=3 |chapter=23.1: Control Codes |title=The Unicode Standard |edition=15.0.0 |date=2022 |publisher=Unicode Consortium |isbn=978-1-936213-32-0 |pages=914–916}}
Unicode includes many additional format effector characters besides these, such as marks, embeds, isolates and pops for explicit bidirectional formatting, and the zero-width joiner and non-joiner for controlling ligature use. However these are given the general category {{code|Cf}} (format) rather than {{code|Cc}}.
See also
- Control Pictures - Unicode graphical representation characters for the C0 control codes
- ANSI escape code
Footnotes
{{notelist}}
References
{{reflist}}
- The Unicode Standard
- [https://www.unicode.org/charts/PDF/U0000.pdf C0 Controls and Basic Latin]
- [https://www.unicode.org/charts/PDF/U0080.pdf C1 Controls and Latin-1 Supplement]
- [https://www.unicode.org/charts/PDF/U2400.pdf Control Pictures]
- The Unicode Standard, Version 6.1.0, [https://www.unicode.org/versions/Unicode6.1.0/ch16.pdf Chapter 16: Special Areas and Format Characters]
- [http://www.atis.org/glossary/ ATIS Telecom Glossary 2007]
- [http://www.w3.org/People/cmsmcq/2007/C1.xml De litteris regentibus C1 quaestiones septem or Are C1 characters legal in XHTML 1.0?]
- [http://www.w3.org/International/questions/qa-controls W3C I18N FAQ: HTML, XHTML, XML and Control Codes]
- [https://itscj.ipsj.or.jp/english/vbcqpr00000004qn-att/ISO-IR.pdf International register of coded character sets to be used with escape sequences]
{{character encoding}}