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 00 HEX –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.
ASCII defined 32 control characters, plus a necessary extra character for the DEL character, 7FHEX or 01111111BIN (needed to punch out all the holes on a paper tape and erase it).
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 [1] (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 [2] and Python's splitlines string method. [3]
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.
Decimal | Hexadecimal | Abbreviations | Name | Description | |||||
---|---|---|---|---|---|---|---|---|---|
^@ | 0 | 00 | NUL | ␀ | Null | \0 | Does nothing. The code of blank paper tape, and also used for padding to slow transmission. | ||
^A | 1 | 01 | TC1, SOH | ␁ | Start of Heading | First character of the heading of a message. [5] | |||
^B | 2 | 02 | TC2, STX | ␂ | Start of Text | Terminates the header and starts the message text. | |||
^C | 3 | 03 | TC3, ETX | ␃ | End of Text | Ends the message text, starts a footer (up to the next TC character). [5] [6] | |||
^D | 4 | 04 | TC4, EOT | ␄ | End of Transmission | Ends the transmission of one or more messages. [5] [6] May place terminals on standby. [6] | |||
^E | 5 | 05 | TC5, ENQ, WRU [a] | ␅ | Enquiry | Trigger a response at the receiving end, to see if it is still present. | |||
^F | 6 | 06 | TC6, ACK | ␆ | Acknowledge | Indication of successful receipt of a message. | |||
^G | 7 | 07 | BEL [b] | ␇ | Bell, Alert | \a | Call for attention from an operator. | ||
^H | 8 | 08 | FE0, BS | ␈ | Backspace | \b | Move one position leftwards. Next character may overprint or replace the character that was there. | ||
^I | 9 | 09 | FE1, HT | ␉ | Character Tabulation, Horizontal Tabulation | \t | Move right to the next tab stop. | ||
^J | 10 | 0A | FE2, LF | ␊ | Line Feed | \n | Move down to the same position on the next line (some devices also moved to the left column). | ||
^K | 11 | 0B | FE3, VT | ␋ | Line Tabulation, Vertical Tabulation | \v | Move down to the next vertical tab stop. | ||
^L | 12 | 0C | FE4, FF | ␌ | Form Feed | \f | Move down to the top of the next page. | ||
^M | 13 | 0D | FE5, CR | ␍ | Carriage Return | \r | Move to column zero while staying on the same line. | ||
^N | 14 | 0E | SO, LS1 [13] [c] | ␎ | Shift Out | Switch to an alternative character set. | |||
^O | 15 | 0F | SI, LS0 [13] [c] | ␏ | Shift In | Return to regular character set after SO. | |||
^P | 16 | 10 | TC7, DC0, [d] DLE | ␐ | Data Link Escape | Cause a limited number of contiguously following characters to be interpreted in some different way. [15] [16] | |||
^Q | 17 | 11 | DC1, XON | ␑ | Device Control One | Turn on (DC1 and DC2) or off (DC3 and DC4) devices. Teletype [7] used these for the paper tape reader and the paper tape punch. The first use became the de facto standard for software flow control. [17] | |||
^R | 18 | 12 | DC2, TAPE | ␒ | Device Control Two | ||||
^S | 19 | 13 | DC3, XOFF | ␓ | Device Control Three | ||||
^T | 20 | 14 | DC4, | ␔ | Device Control Four | ||||
^U | 21 | 15 | TC8, NAK | ␕ | Negative Acknowledge | Negative response to a sender, such as a detected error. | |||
^V | 22 | 16 | TC9, SYN | ␖ | Synchronous Idle | Sent in synchronous transmission systems when no other character is being transmitted. | |||
^W | 23 | 17 | TC10, ETB | ␗ | End of Transmission Block | End of a transmission block of data when data are divided into such blocks for transmission purposes. | |||
^X | 24 | 18 | CAN | ␘ | Cancel | Indicates that the data preceding it are in error or are to be disregarded. | |||
^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. [4] | |||
^Z | 26 | 1A | SUB | ␚ | Substitute | Replaces a character that was found to be invalid or in error. Should be ignored. | |||
^[ | 27 | 1B | ESC | ␛ | Escape | \e [e] | Alters the meaning of a limited number of following bytes. Nowadays this is almost always used to introduce an ANSI escape sequence. | ||
^\ | 28 | 1C | IS4, FS | ␜ | File Separator | 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. | |||
^] | 29 | 1D | IS3, GS | ␝ | Group Separator | ||||
^^ | 30 | 1E | IS2, RS | ␞ | Record Separator | ||||
^_ | 31 | 1F | IS1, US | ␟ | Unit Separator | ||||
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. | |||||||||
32 | 20 | SP | ␠ | Space | Move right one character position. | ||||
^? | 127 | 7F | DEL | ␡ | Delete | Should be ignored. Used to delete characters on punched tape by punching out all the holes. |
In 1973, ECMA-35 and ISO 2022 [18] attempted to define a method so an 8-bit "extended ASCII" code could be converted to a corresponding 7-bit code, and vice versa. [19] In a 7-bit environment, the Shift Out ( SO ) would change the meaning of the 96 bytes 0x20 through 0x7F [a] [21] (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 0x80 through 0x9F could not be printed in a 7-bit environment, [19] 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. [19] 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, [22] a specialised set for bibliographic use which was registered in 1979. [23]
The more common general-use ISO/IEC 6429 set was registered in 1983, [24] although the ECMA-48 specification upon which it was based had been first published in 1976 [25] and JIS X 0211 (formerly JIS C 6323). [26] Symbolic names defined by RFC 1345 and early drafts of ISO 10646, but not in ISO/IEC 6429 ( PAD , HOP and SGC ) are also used. [9] [27]
Except for SS2 and SS3 in EUC-JP text, and NEL in text transcoded from EBCDIC, the 8-bit forms of these codes were almost never used. CSI , DCS and 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 NEL Unicode does not provide a "control picture" for any of these. There is also no well-known variation of Caret notation for them either.
ESC+ | Decimal | Hex | Abbr | Name | Description [28] |
---|---|---|---|---|---|
@ | 128 | 80 | PAD [10] | Padding Character [b] | 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. [32] |
A | 129 | 81 | HOP [10] | High Octet Preset [b] | 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. |
B | 130 | 82 | BPH | Break Permitted Here [c] | 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. |
C | 131 | 83 | NBH | No Break Here [c] | Follows the graphic character that is not to be broken. See also word joiner. |
D | 132 | 84 | IND | Index [d] | Move down one line without moving horizontally, to eliminate ambiguity about the meaning of LF. |
E | 133 | 85 | NEL | Next Line | Equivalent to CR+LF, to match the EBCDIC control character. |
F | 134 | 86 | SSA | Start of Selected Area | Used by block-oriented terminals. In xterm ESC F moves to the lower-left corner of the screen, since certain software assumes this behaviour. [35] |
G | 135 | 87 | ESA | End of Selected Area | |
H | 136 | 88 | HTS |
| Set a tab stop at the current position. |
I | 137 | 89 | HTJ |
| Right-justify the text since the last tab against the next tab stop. |
J | 138 | 8A | VTS |
| Set a vertical tab stop. |
K | 139 | 8B | PLD |
| To produce subscripts and superscripts in ISO/IEC 6429. Subscripts use PLD text PLU while superscripts use PLU text PLD . |
L | 140 | 8C | PLU |
| |
M | 141 | 8D | RI |
| Move up one line. |
N | 142 | 8E | SS2 | Single-Shift 2 | Next character is from the G2 or G3 sets, respectively. |
O | 143 | 8F | SS3 | Single-Shift 3 | |
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. [36] |
Q | 145 | 91 | PU1 | Private Use 1 | Reserved for private function agreed on between the sender and the recipient of the data. |
R | 146 | 92 | PU2 | Private Use 2 | |
S | 147 | 93 | STS | Set Transmit State | |
T | 148 | 94 | CCH | Cancel character | Destructive backspace, to eliminate ambiguity about meaning of BS . |
U | 149 | 95 | MW | Message Waiting | |
V | 150 | 96 | SPA | Start of Protected Area | Used by block-oriented terminals. |
W | 151 | 97 | EPA | End of Protected Area | |
X | 152 | 98 | SOS | Start of String [c] | Followed by a control string terminated by ST (0x9C) which (unlike DCS , OSC , PM or APC ) may contain any character except SOS or ST. |
Y | 153 | 99 | SGC, [10] SGCI [37] | Single Graphic Character Introducer [b] | Intended to allow an arbitrary Unicode character to be printed; it would be followed by that character, most likely encoded in UTF-1. [37] |
Z | 154 | 9A | SCI | Single Character Introducer [c] | 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. |
[ | 155 | 9B | CSI | Control Sequence Introducer | Used to introduce control sequences that take parameters. Used for ANSI escape sequences. |
\ | 156 | 9C | ST | String Terminator | Terminates a string started by DCS , SOS , OSC , PM or APC . |
] | 157 | 9D | OSC | Operating System Command | 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 BEL instead of ST. [38] Kermit used APC to transmit commands. [39] |
^ | 158 | 9E | PM | Privacy Message | |
_ | 159 | 9F | APC | Application Program Command |
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 ESC ! @
and the above C1 set chosen with the sequence ESC " C
. [24]
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, [40] [41] SP and DEL [a] "fixed" coded characters, which are available in their ASCII locations in all encodings that conform to the standard. [43] It also specifies that if a C0 set included transmission control (TCn) codes, they must be encoded at their ASCII locations [40] and could not be put in a C1 set, [44] and any new transmission controls must be in a C1 set. [40]
Unicode reserves the 65 code points described above for compatibility with the C0 and C1 control codes, giving them the general category Cc
(control). These are:
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. [55] 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. [55]
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 Cf
(format) rather than Cc
.
Extended Binary Coded Decimal Interchange Code is an eight-bit character encoding used mainly on IBM mainframe and IBM midrange computer operating systems. It descended from the code used with punched cards and the corresponding six-bit binary-coded decimal code used with most of IBM's computer peripherals of the late 1950s and early 1960s. It is supported by various non-IBM platforms, such as Fujitsu-Siemens' BS2000/OSD, OS-IV, MSP, and MSP-EX, the SDS Sigma series, Unisys VS/9, Unisys MCP and ICL VME.
ISO/IEC 8859-1:1998, Information technology—8-bit single-byte coded graphic character sets—Part 1: Latin alphabet No. 1, is part of the ISO/IEC 8859 series of ASCII-based standard character encodings, first edition published in 1987. ISO/IEC 8859-1 encodes what it refers to as "Latin alphabet no. 1", consisting of 191 characters from the Latin script. This character-encoding scheme is used throughout the Americas, Western Europe, Oceania, and much of Africa. It is the basis for some popular 8-bit character sets and the first two blocks of characters in Unicode.
ISO/IEC 8859-3:1999, Information technology — 8-bit single-byte coded graphic character sets — Part 3: Latin alphabet No. 3, is part of the ISO/IEC 8859 series of ASCII-based standard character encodings, first edition published in 1988. It is informally referred to as Latin-3 or South European. It was designed to cover Turkish, Maltese and Esperanto, though the introduction of ISO/IEC 8859-9 superseded it for Turkish. The encoding was popular for users of Esperanto, but fell out of use as application support for Unicode became more common.
ISO/IEC 646 is a set of ISO/IEC standards, described as Information technology — ISO 7-bit coded character set for information interchange, and developed in cooperation with ASCII at least since 1964. Since its first edition in 1967 it has specified a 7-bit character code from which several national standards are derived.
ISO/IEC 8859-8, Information technology — 8-bit single-byte coded graphic character sets — Part 8: Latin/Hebrew alphabet, is part of the ISO/IEC 8859 series of ASCII-based standard character encodings. ISO/IEC 8859-8:1999 from 1999 represents its second and current revision, preceded by the first edition ISO/IEC 8859-8:1988 in 1988. It is informally referred to as Latin/Hebrew. ISO/IEC 8859-8 covers all the Hebrew letters, but no Hebrew vowel signs. IBM assigned code page 916 to it. This character set was also adopted by Israeli Standard SI1311:2002, with some extensions.
ISO/IEC 8859-4:1998, Information technology — 8-bit single-byte coded graphic character sets — Part 4: Latin alphabet No. 4, is part of the ISO/IEC 8859 series of ASCII-based standard character encodings, first edition published in 1988. It is informally referred to as Latin-4 or North European. It was designed to cover Estonian, Latvian, Lithuanian, Greenlandic, and Sámi. It has been largely superseded by ISO/IEC 8859-10 and Unicode. Microsoft has assigned code page 28594 a.k.a. Windows-28594 to ISO-8859-4 in Windows. IBM has assigned code page 914 to ISO 8859-4.
ISO/IEC 8859-5:1999, Information technology — 8-bit single-byte coded graphic character sets — Part 5: Latin/Cyrillic alphabet, is part of the ISO/IEC 8859 series of ASCII-based standard character encodings, first edition published in 1988. It is informally referred to as Latin/Cyrillic.
ISO/IEC 8859-6:1999, Information technology — 8-bit single-byte coded graphic character sets — Part 6: Latin/Arabic alphabet, is part of the ISO/IEC 8859 series of ASCII-based standard character encodings, first edition published in 1987. It is informally referred to as Latin/Arabic. It was designed to cover Arabic. Only nominal letters are encoded, no preshaped forms of the letters, so shaping processing is required for display. It does not include the extra letters needed to write most Arabic-script languages other than Arabic itself.
ISO/IEC 8859-10:1998, Information technology — 8-bit single-byte coded graphic character sets — Part 10: Latin alphabet No. 6, is part of the ISO/IEC 8859 series of ASCII-based standard character encodings, first edition published in 1992. It is informally referred to as Latin-6. It was designed to cover the Nordic languages, deemed of more use for them than ISO 8859-4.
ISO/IEC 8859-13:1998, Information technology — 8-bit single-byte coded graphic character sets — Part 13: Latin alphabet No. 7, is part of the ISO/IEC 8859 series of ASCII-based standard character encodings, first edition published in 1998. It is informally referred to as Latin-7 or Baltic Rim. It was designed to cover the Baltic languages, and added characters used in Polish missing from the earlier encodings ISO 8859-4 and ISO 8859-10. Unlike these two, it does not cover the Nordic languages. It is similar to the earlier-published Windows-1257; its encoding of the Estonian alphabet also matches IBM-922.
ISO/IEC 8859-14:1998, Information technology — 8-bit single-byte coded graphic character sets — Part 14: Latin alphabet No. 8 (Celtic), is part of the ISO/IEC 8859 series of ASCII-based standard character encodings, first edition published in 1998. It is informally referred to as Latin-8 or Celtic. It was designed to cover the Celtic languages, such as Irish, Manx, Scottish Gaelic, Welsh, Cornish, and Breton.
ISO/IEC 8859-16:2001, Information technology — 8-bit single-byte coded graphic character sets — Part 16: Latin alphabet No. 10, is part of the ISO/IEC 8859 series of ASCII-based standard character encodings, first edition published in 2001. The same encoding was defined as Romanian Standard SR 14111 in 1998, named the "Romanian Character Set for Information Interchange". It is informally referred to as Latin-10 or South-Eastern European. It was designed to cover Albanian, Croatian, Hungarian, Polish, Romanian, Serbian and Slovenian, but also French, German, Italian and Irish Gaelic.
ISO/IEC 2022Information technology—Character code structure and extension techniques, is an ISO/IEC standard in the field of character encoding. It is equivalent to the ECMA standard ECMA-35, the ANSI standard ANSI X3.41 and the Japanese Industrial Standard JIS X 0202. Originating in 1971, it was most recently revised in 1994.
T.61 is an ITU-T Recommendation for a Teletex character set. T.61 predated Unicode, and was the primary character set in ASN.1 used in early versions of X.500 and X.509 for encoding strings containing characters used in Western European languages. It is also used by older versions of LDAP. While T.61 continues to be supported in modern versions of X.500 and X.509, it has been deprecated in favor of Unicode. It is also called Code page 1036, CP1036, or IBM 01036.
Shift Out (SO) and Shift In (SI) are ASCII control characters 14 and 15, respectively. These are sometimes also called "Control-N" and "Control-O".
T.51 / ISO/IEC 6937:2001, Information technology — Coded graphic character set for text communication — Latin alphabet, is a multibyte extension of ASCII, or more precisely ISO/IEC 646-IRV. It was developed in common with ITU-T for telematic services under the name of T.51, and first became an ISO standard in 1983. Certain byte codes are used as lead bytes for letters with diacritics. The value of the lead byte often indicates which diacritic that the letter has, and the follow byte then has the ASCII-value for the letter that the diacritic is on.
Many Unicode characters are used to control the interpretation or display of text, but these characters themselves have no visual or spatial representation. For example, the null character is used in C-programming application environments to indicate the end of a string of characters. In this way, these programs only require a single starting memory address for a string, since the string ends once the program reads the null character.
The MARC-8 charset is a MARC standard used in MARC-21 library records. The MARC formats are standards for the representation and communication of bibliographic and related information in machine-readable form, and they are frequently used in library database systems. The character encoding now known as MARC-8 was introduced in 1968 as part of the MARC format. Originally based on the Latin alphabet, from 1979 to 1983 the JACKPHY initiative expanded the repertoire to include Japanese, Arabic, Chinese, and Hebrew characters, with the later addition of Cyrillic and Greek scripts. If a character is not representable in MARC-8 of a MARC-21 record, then UTF-8 must be used instead. UTF-8 has support for many more characters than MARC-8, which is rarely used outside library data.
The ISO 2033:1983 standard defines character sets for use with Optical Character Recognition or Magnetic Ink Character Recognition systems. The Japanese standard JIS X 9010:1984 is closely related.
ISO/IEC 10367:1991 is a standard developed by ISO/IEC JTC 1/SC 2, defining graphical character sets for use in character encodings implementing levels 2 and 3 of ISO/IEC 4873.
{{citation}}
: CS1 maint: numeric names: authors list (link){{citation}}
: CS1 maint: numeric names: authors list (link){{citation}}
: CS1 maint: numeric names: authors list (link){{citation}}
: CS1 maint: numeric names: authors list (link){{citation}}
: CS1 maint: numeric names: authors list (link){{citation}}
: CS1 maint: numeric names: authors list (link){{citation}}
: CS1 maint: numeric names: authors list (link){{cite book}}
: CS1 maint: numeric names: authors list (link){{cite book}}
: CS1 maint: numeric names: authors list (link){{cite book}}
: CS1 maint: numeric names: authors list (link){{citation}}
: CS1 maint: numeric names: authors list (link){{citation}}
: CS1 maint: numeric names: authors list (link){{citation}}
: CS1 maint: numeric names: authors list (link){{cite web}}
: CS1 maint: numeric names: authors list (link){{citation}}
: CS1 maint: numeric names: authors list (link){{citation}}
: CS1 maint: numeric names: authors list (link){{citation}}
: CS1 maint: numeric names: authors list (link)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