C0 and C1 control codes(传输协议中常见的控制位)

转自:http://en.wikipedia.org/wiki/C0_and_C1_control_codes

C0 (ASCII and derivatives)

These are the standard ASCII control codes. If using theISO/IEC 2022extension mechanism, they are designated as the active C0 control character set with the octet sequence0x1B 0x21 0x40(ESC!@).

Seq Dec Hex Acro Symb Name C Description
^@0000NULNull\0Originally 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 carriage return or line feed on a printing terminal). Now often used as a string terminator, especially in theC programming language.
^A0101SOHStart of HeadingFirst character of a message header.
^B0202STXStart of textFirst character of message text, and may be used to terminate the message heading.
^C0303ETXEnd of TextOften used as a "break" character (Ctrl-C) to interrupt or terminate a program or process.
^D0404EOTEnd of TransmissionUsed onUnixto signal end-of-file condition on, or to logout from a terminal.
^E0505ENQEnquirySignal intended to trigger a response at the receiving end, to see if it is still present.
^F0606ACKAcknowledgeResponse to an ENQ, or an indication of successful receipt of a message.
^G0707BELBell\aOriginally used to sound abellon the terminal. Later used for a beep on systems that didn't have a physical bell. May also quickly turn on and offinverse video(avisual bell).
^H0808BSBackspace\bMove the cursor one position leftwards. On input, this may delete the character to the left of the cursor. On output, where in early computer technology a character once printed could not be erased, the backspace was sometimes used to generate accented characters in ASCII. For example,àcould be produced using the three character sequencea BS `(0x61 0x08 0x60). This usage is now deprecated and generally not supported. To provide disambiguation between the two potential uses of backspace, thecancel charactercontrol code was made part of the standard C1 control set.
^I0909HTCharacter Tabulation,Horizontal Tabulation \tPosition to the next charactertab stop.
^J100ALFLine Feed\nOntypewriters,printers, and some terminal emulators, moves the cursor down one row without affecting its column position. On Unix, used to markend-of-line. InMS-DOS,Windows, and various network standards, LF is used following CR as part of the end-of-line mark.
^K110BVTLine Tabulation,Vertical Tabulation \vPosition the form at the next line tab stop.
^L120CFFForm Feed\fOn printers, load the next page. Treated as whitespace in many programming languages, and may be used to separate logical divisions in code. In some terminal emulators, it clears the screen.
^M130DCRCarriage Return\rOriginally used to move the cursor to column zero while staying on the same line. OnMac OS(pre-Mac OS X), as well as in earlier systems such as theApple IIandCommodore 64, used to markend-of-line. InMS-DOS,Windows, and various network standards, it is used preceding LF as part of the end-of-line mark. The Enter orReturn keyon a keyboard will send this character, but it may be converted to a different end-of-line sequence by a terminal program.
^N140ESOShift OutSwitch to an alternate character set.
^O150FSIShift InReturn to regular character set after Shift Out.
^P1610DLEData Link EscapeCause the following octets to be interpreted as raw data, not as control codes or graphic characters. Returning to normal usage would be implementation dependent.
^Q1711DC1 Device ControlOne (XON)These four control codes are reserved for device control, with the interpretation dependent upon the device they were connected. DC1 and DC2 were intended primarily to indicate activating a device while DC3 and DC4 were intended primarily to indicate pausing or turning off a device. In actual practice DC1 and DC3 (known also as XON and XOFF respectively in this usage) quickly became the de facto standard for softwareflow control.
^R1812DC2Device Control Two
^S1913DC3Device Control Three (XOFF)
^T2014DC4Device Control Four
^U2115NAKNegative AcknowledgeSent by a station as a negative response to the station with which the connection has been set up. In binary synchronous communication protocol, the NAK is used to indicate that an error was detected in the previously received block and that the receiver is ready to accept retransmission of that block. In multipoint systems, the NAK is used as the not-ready reply to a poll.
^V2216SYNSynchronous IdleUsed in synchronous transmission systems to provide a signal from which synchronous correction may be achieved between data terminal equipment, particularly when no other character is being transmitted.
^W2317ETBEnd of Transmission BlockIndicates the end of a transmission block of data when data are divided into such blocks for transmission purposes.
^X2418CANCancelIndicates that the data preceding it are in error or are to be disregarded.
^Y2519EMEnd of mediumIntended as means of indicating on paper or magnetic tapes that the end of the usable portion of the tape had been reached.
^Z261ASUBSubstituteOriginally intended for use as a transmission control character to indicate that garbled or invalid characters had been received. It has often been put to use for other purposes when thein-band signalingof errors it provides is unneeded, especially where robust methods oferror detection and correctionare used, or where errors are expected to be rare enough to make using the character for other purposes advisable.
^[271BESCEscapeTheEsc keyon the keyboard will cause this character to be sent on most systems. It can be used in software user interfaces to exit from a screen, menu, or mode, or in device-control protocols (e.g., printers and terminals) to signal that what follows is a special command sequence rather than normal text. In systems based onISO/IEC 2022, even if another set of C0 control codes are used, this octet is required to always represent the escape character.
^\281CFSFile SeparatorCan be used as delimiters to mark fields of data structures. If used for hierarchical levels, US is the lowest level (dividing plain-text data items), while RS, GS, and FS are of increasing level to divide groups made up of items of the level beneath it.
^]291DGSGroup separator
^^301ERSRecord Separator
^_311FUSUnit separator
While not technically part of the C0 control character range, the following two characters are defined inISO/IEC 2022as always being available regardless of which sets of control characters and graphics characters have been registered. They can be thought of as having some characteristics of control characters.
3220SPSpaceSpace is a graphic character. It has a visual representation consisting of the absence of a graphic symbol. It causes the active position to be advanced by one character position. In some applications, Space can be considered a lowest-level "word separator" to be used with the adjacent separator characters.
^?1277FDELDeleteNot technically part of the C0 control character range, this was originally used to mark deleted characters on paper tape, since any character could be changed to all ones by punching holes everywhere. OnVT100compatible terminals, this is the character generated by the key labelled, usually called backspace on modern machines, and does not correspond to the PCdelete key.

C1 set

These are the most common extended control codes. If using theISO/IEC 2022extension mechanism, they are designated as the active C1 control character set with the sequence0x1B 0x22 0x43(ESC " C). Individual control functions can be accessed with the 7-bit equivalents0x1B 0x40through0x1B 0x5F(ESC @throughESC _).

Esc+ Dec Hex Acro Name Description
@12880PADPadding CharacterListed as XXX in Unicode. Not part ofISO/IEC 6429(ECMA-48).
A12981HOPHigh Octet Preset
B13082BPHBreak Permitted HereFollows a graphic character where a line break is permitted. Roughly equivalent to asoft hyphenexcept that the means for indicating a line break is not necessarily a hyphen. Not part of the first edition of ISO/IEC 6429.[1]
C13183NBHNo Break HereFollows the graphic character that is not to be broken. Not part of the first edition of ISO/IEC 6429.[1]
D13284INDIndexMove the active position one line down, to eliminate ambiguity about the meaning of LF. Deprecated in 1988 and withdrawn in 1992 from ISO/IEC 6429 (1986 and 1991 respectively for ECMA-48).
E13385NELNext LineEquivalent to CR+LF. Used to mark end-of-line on some IBM mainframes.
F13486SSAStart of Selected AreaUsed byblock-oriented terminals.
G13587ESAEnd of Selected Area
H13688HTSCharacter Tabulation Set
Horizontal Tabulation Set
Causes a character tabulation stop to be set at the active position.
I13789HTJCharacter Tabulation With Justification
Horizontal Tabulation With Justification
Similar to Character Tabulation, except that instead of spaces or lines being placed after the preceding characters until the next tab stop is reached, the spaces or lines are placed preceding the active field so that preceding graphic character is placed just before the next tab stop.
J1388AVTSLine Tabulation Set
Vertical Tabulation Set
Causes a line tabulation stop to be set at the active position.
K1398BPLDPartial Line Forward
Partial Line Down
Used to produce subscripts and superscripts inISO/IEC 6429, e.g., in a printer.
Subscripts usePLDtextPLUwhile superscripts usePLUtextPLD..
L1408CPLUPartial Line Backward
Partial Line Up
M1418DRIReverse Line Feed
Reverse Index
N1428ESS2Single-Shift 2Next character invokes a graphic character from the G2 or G3 graphic sets respectively. In systems that conform toISO/IEC 4873(ECMA-43), even if a C1 set other than the default is used, these two octets may only be used for this purpose.
O1438FSS3Single-Shift 3
P14490DCSDevice Control StringFollowed by a string of printable characters (0x20 through 0x7E) and format effectors (0x08 through 0x0D), terminated by ST (0x9C).
Q14591PU1Private Use 1Reserved for a function without standardized meaning for private use as required, subject to the prior agreement of the sender and the recipient of the data.
R14692PU2Private Use 2
S14793STSSet Transmit State
T14894CCHCancel characterDestructive backspace, intended to eliminate ambiguity about meaning of BS.
U14995MWMessage Waiting
V15096SPAStart of Protected AreaUsed byblock-oriented terminals.
W15197EPAEnd of Protected Area
X15298SOSStart of StringFollowed by a control string terminated by ST (0x9C) that may contain any character except SOS or ST. Not part of the first edition of ISO/IEC 6429.[1]
Y15399SGCISingle Graphic Character IntroducerListed as XXX in Unicode. Not part of ISO/IEC 6429.
Z1549ASCISingle Character IntroducerTo be followed by a single printable character (0x20 through 0x7E) or format effector (0x08 through 0x0D). The intent was to provide a means by which a control function or a graphic character that would be available regardless of which graphic or control sets were in use could be defined. Definitions of what the following byte would invoke was never implemented in an international standard. Not part of the first edition of ISO/IEC 6429.[1]
[1559BCSIControl Sequence IntroducerUsed to introduce control sequences that take parameters.
\1569CSTString Terminator
]1579DOSCOperating System CommandFollowed by a string of printable characters (0x20 through 0x7E) and format effectors (0x08 through 0x0D), terminated by ST (0x9C). These three control codes were intended for use to allow in-band signaling of protocol information, but are rarely used for that purpose.
^1589EPMPrivacy Message
_1599FAPCApplication Program Command

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值