C0 and C1 control codes
(Redirected from C0)
Categories: Control characters
The C0 and C1 control code sets define control codes for use in text. C0, originally defined in ISO 646, defines codes in the range 00HEX-1FHEX. C1, originally defined in ISO 6429, defines codes in the range 80HEX-9FHEX. The C0 codes are used with ASCII and most encodings based on it. The C1 codes were included in the ISO-8859-n series of encodings and Unicode but are rarely used.
Contents |
[edit]
C0 (ascii and derivatives)
| Seq | Dec | Hex | Abbr | Character name | Description/notes |
|---|---|---|---|---|---|
| ^@ | 00 | 0x00 | NUL | Null | Originally used to allow gaps to be left on paper tape for edits. Later used for padding after a code that might take a terminal some time to process (e.g. a carrage return or line feed on a priniting terminal). Now often used as a string terminator, especially in C. |
| ^A | 01 | 0x01 | SOH | Start of Heading | |
| ^B | 02 | 0x02 | STX | Start of Text | |
| ^C | 03 | 0x03 | ETX | End of Text | Often used as a "break" character (Ctrl-C). |
| ^D | 04 | 0x04 | EOT | End of Transmission | Used to represent the end-of-file in Unix. However, MS-DOS uses ^Z for end-of-file. |
| ^E | 05 | 0x05 | ENQ | Enquiry | |
| ^F | 06 | 0x06 | ACK | Acknowledge | |
| ^G | 07 | 0x07 | BEL | Bell | Originally used to sound a bell on the terminal. Later used for a beep on systems that didn't have a physical bell. May also quickly turn on and off reverse video (a visual bell). |
| ^H | 08 | 0x08 | BS | Backspace | Deletes the character to the left and moves the cursor left. |
| ^I | 09 | 0x09 | HT | Horizontal Tab | Generally referred to as simply "tab". |
| ^J | 10 | 0x0A | LF | Line Feed | On typewriters, printers, and some terminal emulators, moves the cursor down one row without affecting its column position. On Unix, used as to mark end-of-line. |
| ^K | 11 | 0x0B | VT | Vertical Tab | |
| ^L | 12 | 0x0C | FF | Form Feed | On printers, load the next page. Treated as whitespace by Python, and may be used to separate logical divisions in code. |
| ^M | 13 | 0x0D | CR | Carriage Return | Originally used to move the cursor to column zero. On Mac OS (pre-Mac OS X), used to mark end-of-line. |
| ^N | 14 | 0x0E | SO | Shift Out | Switch to an alternate character set. |
| ^O | 15 | 0x0F | SI | Shift In | |
| ^P | 16 | 0x10 | DLE | Data Link Escape | Cause the following data to be interpreted as raw data, not control codes. |
| ^Q | 17 | 0x11 | DC1 | Device Control 1/XOFF | Resume transmission. Used for software flow control. |
| ^R | 18 | 0x12 | DC2 | Device Control 2 | |
| ^S | 19 | 0x13 | DC3 | Device Control 3/XON | Suspend transmission. Used for software flow control. |
| ^T | 20 | 0x14 | DC4 | Device Control 4 | |
| ^U | 21 | 0x15 | NAK | Negative Acknowledge | |
| ^V | 22 | 0x16 | SYN | Synchronous Idle | |
| ^W | 23 | 0x17 | ETB | End of Transmission Block | |
| ^X | 24 | 0x18 | CAN | Cancel | |
| ^Y | 25 | 0x19 | EM | End of Medium | |
| ^Z | 26 | 0x1A | SUB | Substitute | On MS-DOS systems with files opened in text mode, "end of text" or "end of file" is marked by the Ctrl-Z character (code 26, "Substitute"), instead of ^C or ^D common on other operating systems. |
| ^[ | 27 | 0x1B | ESC | Escape | |
| ^\ | 28 | 0x1C | FS | File Separator | |
| ^] | 29 | 0x1D | GS | Group Separator | |
| ^^ | 30 | 0x1E | RS | Record Separator | |
| ^_ | 31 | 0x1F | US | Unit Separator | |
| 127 | 0x7F | DEL | Rubout/Delete | Originally used to mark deleted characters on paper tape, since any character could be changed to all ones by punching holes everywhere. In modern systems, used to delete the character to the right of the cursor. |
[edit]
C1 (ISO-8859 and unicode)
| Dec | Hex | Abbr | Character name | Description/notes |
|---|---|---|---|---|
| 128 | 0x80 | PAD | Padding Character | |
| 129 | 0x81 | HOP | High Octet Preset | |
| 130 | 0x82 | BPH | Break Permitted Here | |
| 131 | 0x83 | NBH | No Break Here | |
| 132 | 0x84 | IND | Index | |
| 133 | 0x85 | NEL | Next Line | Used to mark end-of-line on some IBM mainframes. |
| 134 | 0x86 | SSA | Start of Selected Area | |
| 135 | 0x87 | ESA | End of Selected Area | |
| 136 | 0x88 | HTS | Horizontal Tab Set | |
| 137 | 0x89 | HTJ | Horizontal Tab Justified | |
| 138 | 0x8A | VTS | Vertical Tab Set | |
| 139 | 0x8B | PLD | Partial Line Forward | |
| 140 | 0x8C | PLU | Partial Line Backward | |
| 141 | 0x8D | RI | Reverse Line Feed | |
| 142 | 0x8E | SS2 | Single-Shift 2 | |
| 143 | 0x8F | SS3 | Single-Shift 3 | |
| 144 | 0x90 | DCS | Device Control String | |
| 145 | 0x91 | PU1 | Private Use 1 | |
| 146 | 0x92 | PU2 | Private Use 2 | |
| 147 | 0x93 | STS | Set Transmit State | |
| 148 | 0x94 | CCH | Cancel Character | |
| 149 | 0x95 | MW | Message Waiting | |
| 150 | 0x96 | SPA | Start of Protected Area | |
| 151 | 0x97 | EPA | End of Protected Area | |
| 152 | 0x98 | SOS | Start of String | |
| 153 | 0x99 | SGCI | Single Graphic Char Intro | |
| 154 | 0x9A | SCI | Single Char Intro | |
| 155 | 0x9B | CSI | Control Sequence Intro | |
| 156 | 0x9C | ST | String Terminator | |
| 157 | 0x9D | OSC | OS Command | |
| 158 | 0x9E | PM | Private Message | |
| 159 | 0x9F | APC | App Program Command |
[edit]