C0 and C1 control codes
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. C1 codes are the range 80HEX–9FHEX and the default C1 set was originally defined in ECMA-48. 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.
C0 controls
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 characters BS, HT, 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" such as the Unix info format and Python's string method.
The names of some codes were changed in ISO 6429:1992 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.
Unicode provides Control Pictures that can replace C0 control characters to make them visible on screen. However caret notation is used more often.
C1 controls
In 1973, ECMA-35 and ISO 2022 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 would change the meaning of the 96 bytes through , 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 through could not be printed in a 7-bit environment, 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 sequencesESC @ 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 and JIS X 0211. Symbolic names defined by and early drafts of ISO 10646, but not in ISO/IEC 6429 are also used.
Except for and in EUC-JP text, and in text transcoded from EBCDIC, the 8-bit forms of these codes were almost never used., and 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, Unicode does not provide a "control picture" for any of these. There is no well-known variation of Caret notation for them either.
| Abbr | Name | Description | |||
| @ | 128 | 80 | PAD | Padding Character | 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 occasionally uses this. |
| A | 129 | 81 | HOP | High Octet Preset | 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 | 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 | Follows the graphic character that is not to be broken. See also word joiner. |
| D | 132 | 84 | IND | Index | 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 moves to the lower-left corner of the screen, since certain software assumes this behaviour. |
| G | 135 | 87 | ESA | End of Selected Area | Used by block-oriented terminals. In xterm moves to the lower-left corner of the screen, since certain software assumes this behaviour. |
| 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 | To produce subscripts and superscripts in ISO/IEC 6429. Subscripts use PLD text PLU while superscripts use PLU text PLD. | |
| M | 141 | 8D | RI | Move up one line. | |
| N | 142 | 8E | SS2 | Next character is from the G2 or G3 sets, respectively. | |
| O | 143 | 8F | SS3 | Next character is from the G2 or G3 sets, respectively. | |
| P | 144 | 90 | DCS | Device Control String | Followed by a string of printable characters and format effectors, terminated by ST. Xterm defined a number of these. |
| 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 | Reserved for private function agreed on between the sender and the recipient of the data. |
| S | 147 | 93 | STS | Set Transmit State | |
| T | 148 | 94 | CCH | Cancel character | Destructive backspace, to eliminate ambiguity about meaning of. |
| 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 | Used by block-oriented terminals. |
| X | 152 | 98 | SOS | Start of String | Followed by a control string terminated by which may contain any character except SOS or ST. |
| Y | 153 | 99 | SGC, SGCI | Single Graphic Character Introducer | Intended to allow an arbitrary Unicode character to be printed; it would be followed by 4 bytes to define a 32-bit code point, most likely big-endian. |
| Z | 154 | 9A | SCI | Single Character Introducer | To be followed by a single printable character or format effector, and to print it as ASCII no matter what graphic or control sets were in use. |
| 157 | 9D | OSC | Operating System Command | Followed by a string of printable characters and format effectors, terminated by ST, 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 instead of ST. Kermit used APC to transmit commands. | |
| ^ | 158 | 9E | PM | Privacy Message | Followed by a string of printable characters and format effectors, terminated by ST, 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 instead of ST. Kermit used APC to transmit commands. |
| _ | 159 | 9F | APC | Application Program Command | Followed by a string of printable characters and format effectors, terminated by ST, 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 instead of ST. Kermit used APC to transmit commands. |