>Info zum Stichwort Unix | >diskutieren | >Permalink 
يادداشت schrieb am 15.8. 2006 um 14:57:20 Uhr über

Unix

Ascii control codes (control characters, C0 controls)

The following document lists the control codes (control characters) in Ascii and in newer character code standards like Unicode, which generally try to be compatible with Ascii in the Ascii code range (positions 0 through 127).
code pos. Unicode Description in C0 of ISO 646
dec. hex. abbr. name
0 0 NUL NULL A control character used to accomplish media-fill or time-fill. Null characters may be inserted into or removed from a stream of data without affecting the information content of that stream. But then the addition or removal of these characters may affect the information layout and/or the control of equipment.
ctl-A 1 1 SOH START OF HEADING A transmission control character used as the first character of a heading of an information message.
ctl-B 2 2 STX START OF TEXT A transmission control character which precedes a text and which is used to terminate a heading.
ctl-C 3 3 ETX END OF TEXT A transmission control character which terminates a text.
ctl-D 4 4 EOT END OF TRANSMISSION A transmission control character used to indicate the conclusion of the transmission of one or more texts..
ctl-E 5 5 ENQ ENQUIRY A transmission control character used as a request for a response from a remote station; the response may include station identification and/or station status. When a »Who are you« function is required on the general switched transmission network, the first use of ENQ after the connection is established shall have the meaning »Who are you« (station identification). Subsequent use of ENQ may, or may not, include the function »Who are you«, as determined by agreement.
ctl-F 6 6 ACK ACKNOWLEDGE A transmission control character transmitted by a receiver as an affirmative response to the sender.
ctl-G 7 7 BEL BELL A control character that is used when there is a need to call for attention; it may control alarm or attention devices.
ctl-H 8 8 BS BACKSPACE A format effector which moves the active position one character position backwards on the same line.
ctl-I 9 9 HT HORIZONTAL TABULATION A format effector which advances the active position to the next pre-determined character position on the same line.
ctl-J 10 A LF LINE FEED A format effector which advances the active position to the same character position of the next line.
ctl-K 11 B VT VERTICAL TABULATION A format effector which advances the active position to the same character position on the next pre-determined line.
ctl-L 12 C FF FORM FEED A format effector which advances the active position to the same character position on a pre-determined line of the next form or page.
ctl-M 13 D CR CARRIAGE RETURN A format effector which moves the active position to the first character position on the same line.
ctl-N 14 E SO SHIFT OUT A control character which is used in conjunction with SHIFT IN and ESCAPE to extend the graphic character set of the code. It may alter the meaning of octets 33 - 126 (dec.). The effect of this character when using code extension techniques is described in International Standard ISO 2022.
ctl-O 15 F SI SHIFT IN A control character which is used in conjunction with SHIFT OUT and ESCAPE to extend the graphic character set of the code. It may reinstate the standard meanings of the octets which follow it. The effect of this character when using code extension techniques is described in International Standard ISO 2022.
ctl-P 16 10 DLE DATA LINK ESCAPE A transmission control character which will change the meaning of a limited number of contiguously following characters. Its is used exclusively to provide supplementary data transmission control functions. Only graphic characters and transmission control characters can be used in DLE sequences.
ctl-Q 17 11 DC1 DEVICE CONTROL ONE A device control character which is primarily intended for turning on or starting an ancillary device. If it is not required for this purpose, it may be used to restore a device to the basic mode of operation (see also DC2 and DC3), or for any other device control function not provided by other DCs.
ctl-R 18 12 DC2 DEVICE CONTROL TWO A device control character which is primarily intended for turning on or starting an ancillary device. If it is not required for this purpose, it may be used to set a device to a special mode of operation (in which case DC1 is used to restore normal operation), or for any other device control function not provided by other DCs.
ctl-S 19 13 DC3 DEVICE CONTROL THREE A device control character which is primarily intended for turning off or stopping an ancillary device. This function may be a secondary level stop, for example, wait, pause, stand-by or halt (in which case DC1 is used to restore normal operation). If it is not required for this purpose, it may be used for any other device control function not provided by other DCs.
ctl-T 20 14 DC4 DEVICE CONTROL FOUR A device control character which is primarily intended for turning off, stopping or interrupting an ancillary device. If it is not required for this purpose, it may be used for any other device control function not provided by other DCs.
ctl-U 21 15 NAK NEGATIVE ACKNOWLEDGE A transmission control character transmitted by a receiver as a negative response to the sender.
ctl-V 22 16 SYN SYNCHRONOUS IDLE A transmission control character used by a synchronous transmission system in the absence of any other character (idle condition) to provide a signal from which synchronism may be achieved or retained between data terminal equipment.
ctl-W 23 17 ETB END OF TRANSMISSION BLOCK A transmission control character used to indicate the end of a transmission block of data where data is divided into such blocks for transmission purposes.
ctl-X 24 18 CAN CANCEL A character, or the first character of a sequence, indicating that the data preceding it is in error. As a result, this data is to be ignored. The specific meaning of this character must be defined for each application and/or between sender and recipient.
ctl-Y 25 19 EM END OF MEDIUM A control character that may be used to identify the physical end of a medium, or the end of the used portion of a medium, or the end of the wanted portion of data recorded on a medium. The position of this character does not necessarily correspond to the physical end of the medium.
ctl-Z 26 1A SUB SUBSTITUTE A control character used in the place of a character that has been found to be invalid or in error. SUB is intended to be introduced by automatic means.
ctl-[ 27 1B ESC ESCAPE A control character which is used to provide additional control functions. It alters the meaning of a limited number of contiguously following bit combinations. The use of this character is specified in International Standard ISO 2022.
ctl-\ 28 1C FS FILE SEPARATOR A control character used to separate and qualify data logically; its specific meaning has to be specified for each application. If this character is used in hierarchical order, it delimits a data item called a file.
ctl-] 29 1D GS GROUP SEPARATOR A control character used to separate and qualify data logically; its specific meaning has to be specified for each application. If this character is used in hierarchical order, it delimits a data item called a group.
ctl-^ 30 1E RS RECORD SEPARATOR A control character used to separate and qualify data logically; its specific meaning has to be specified for each application. If this character is used in hierarchical order, it delimits a data item called a record.
ctl-_ 31 1F US UNIT SEPARATOR A control character used to separate and qualify data logically; its specific meaning has to be specified for each application. If this character is used in hierarchical order, it delimits a data item called a unit.
127 7F DEL DELETE (not defined)

Notes:

* The first column shows the widely used »control-something« name used for control codes. It relates to the fact that on a keyboard, it is often possible to generate a control code using the control (Ctrl, Ctl) key and a normal key.
* The column C0 of ISO 646 quotes the definition in that document, with typos fixed, and with references to characters and code positions changed to use Unicode names and modern terms.

Historical table

The following table lists the original names of Ascii control codes as defined in 1963.
code pos. Ascii 1963
dec. hex. abbr. name
0 0 NULL Null/Idle
1 1 SOM Start of message
2 2 EOA End of address
3 3 EOM End of message
4 4 EOT End of transmission
5 5 WRU »Who are you...?«
6 6 RU »Are you...?«
7 7 BELL Audible signal
8 8 FE0 Format effector
9 9 HT/SK Horizontal tabulation/ Skip (punched card)
10 A LF Line feed
11 B VTAB Vertical tabulation
12 C FF Form feed
13 D CR Carriage return
14 E SO Shift out
15 F SI Shift in
16 10 DC0 Device control reserved for data link escape
17 11 DC1 Device control
18 12 DC2
19 13 DC3
20 14 DC4 (STOP) Device control (stop)
21 15 ERR Error
22 16 SYNC Synchronous idle
23 17 LEM Logical end of media
24 18 S0 Separator (information)
25 19 S1
26 1A S2
27 1B S3
28 1C S4
29 1D S5
30 1E S6
31 1F S7
127 7F DEL Delete/idle

Ascii 1963 assigned code position 126 to the ESC code. Later ESC was moved to position 27, and position 126 was assigned to tilde (~). Similarly ACK was moved from 124 to 6, making room for vertical line (vertical bar, |).

Note: The space character (blank, Ascii code position 32) is not discussed here. It can be classified and processed as a graphic character, or as a control character, or both, depending on context.

Sources:

* American Standard Code for Information Interchange ASA standard X3.4-1963Ascii 1963«); note that it allocated ACK to code position 124 and ESC to code position 126
* C0 Set of ISO 646 in International Register of Coded Character Sets To Be Used With Escape Sequences
* The Unicode Standard.

Date of creation: 2000-10-05. Last modification: 2004-04-20.
Jukka Korpela


   User-Bewertung: /
Juppheidi-Juppheida!

Dein Name:
Deine Assoziationen zu »Unix«:
Hier nichts eingeben, sonst wird der Text nicht gespeichert:
Hier das stehen lassen, sonst wird der Text nicht gespeichert:
 Konfiguration | Web-Blaster | Statistik | »Unix« | Hilfe | Startseite 
0.0196 (0.0068, 0.0113) sek. –– 822367227