Ascii control codes&nb…

来源:互联网 发布:C语言编程输出声音 编辑:程序博客网 时间:2024/06/01 08:49
原文地址:http://www.cs.tut.fi/~jkorpela/chars/c0.html

The following document lists the controlcodes (control characters)in Ascii and in newercharacter code standards like Unicode, which generally try to becompatible with Ascii in the Ascii code range (positions 0 through127).

code pos.UnicodeDescriptionin C0 of ISO 646dec.hex.abbr.name 00NULNULLA control character used to accomplish media-fill or time-fill.Null characters may be inserted into or removed from a stream ofdata without affecting the information content of that stream. Butthen the addition or removal of these characters may affect theinformation layout and/or the control of equipment.ctl-A11SOHSTART OF HEADINGA transmission control character used as the first character ofa heading of an information message.ctl-B22STXSTART OF TEXTA transmission control character which precedes a text andwhich is used to terminate a heading.ctl-C33ETXEND OF TEXTA transmission control character which terminates a text.ctl-D44EOTEND OF TRANSMISSIONA transmission control character used to indicate theconclusion of the transmission of one or more texts..ctl-E55ENQENQUIRYA transmission control character used as a request for aresponse from a remote station; the response may include stationidentification and/or station status. When a "Who are you" functionis required on the general switched transmission network, the firstuse of ENQ after the connection is established shall have themeaning "Who are you" (station identification). Subsequent use ofENQ may, or may not, include the function "Who are you", asdetermined by agreement.ctl-F66ACKACKNOWLEDGEA transmission control character transmitted by a receiver asan affirmative response to the sender.ctl-G77BELBELLA control character that is used when there is a need to callfor attention; it may control alarm or attention devices.ctl-H88BSBACKSPACEA format effector which moves the active position one characterposition backwards on the same line.ctl-I99HTHORIZONTAL TABULATIONA format effector which advances the active position to thenext pre-determined character position on the same line.ctl-J10ALFLINE FEEDA format effector which advances the active position to thesame character position of the next line.ctl-K11BVTVERTICAL TABULATIONA format effector which advances the active position to thesame character position on the next pre-determined line.ctl-L12CFFFORM FEEDA format effector which advances the active position to thesame character position on a pre-determined line of the next formor page.ctl-M13DCRCARRIAGE RETURNA format effector which moves the active position to the firstcharacter position on the same line.ctl-N14ESOSHIFT OUTA control character which is used in conjunction with SHIFT INand ESCAPE to extend the graphic character set of the code. It mayalter the meaning of octets 33 - 126 (dec.). Theeffect of this character when using code extension techniques isdescribed in International Standard ISO 2022.ctl-O15FSISHIFT INA control character which is used in conjunction with SHIFT OUTand ESCAPE to extend the graphic character set of the code. It mayreinstate the standard meanings of the octets which follow it. Theeffect of this character when using code extension techniques isdescribed in International Standard ISO 2022.ctl-P1610DLEDATA LINK ESCAPEA transmission control character which will change the meaningof a limited number of contiguously following characters. Its isused exclusively to provide supplementary data transmission controlfunctions. Only graphic characters and transmission controlcharacters can be used in DLE sequences.ctl-Q1711DC1DEVICE CONTROL ONEA device control character which is primarily intended forturning on or starting an ancillary device. If it is not requiredfor this purpose, it may be used to restore a device to the basicmode of operation (see also DC2 and DC3), or for any other devicecontrol function not provided by other DCs.ctl-R1812DC2DEVICE CONTROL TWOA device control character which is primarily intended forturning on or starting an ancillary device. If it is not requiredfor this purpose, it may be used to set a device to a special modeof operation (in which case DC1 is used to restore normaloperation), or for any other device control function not providedby other DCs.ctl-S1913DC3DEVICE CONTROL THREEA device control character which is primarily intended forturning off or stopping an ancillary device. This function may be asecondary level stop, for example, wait, pause, stand-by or halt(in which case DC1 is used to restore normal operation). If it isnot required for this purpose, it may be used for any other devicecontrol function not provided by other DCs.ctl-T2014DC4DEVICE CONTROL FOURA device control character which is primarily intended forturning off, stopping or interrupting an ancillary device. If it isnot required for this purpose, it may be used for any other devicecontrol function not provided by other DCs.ctl-U2115NAKNEGATIVE ACKNOWLEDGEA transmission control character transmitted by a receiver as anegative response to the sender.ctl-V2216SYNSYNCHRONOUS IDLEA transmission control character used by a synchronoustransmission system in the absence of any other character (idlecondition) to provide a signal from which synchronism may beachieved or retained between data terminal equipment.ctl-W2317ETBEND OF TRANSMISSION BLOCKA transmission control character used to indicate the end of atransmission block of data where data is divided into such blocksfor transmission purposes.ctl-X2418CANCANCELA character, or the first character of a sequence, indicatingthat the data preceding it is in error. As a result, this data isto be ignored. The specific meaning of this character must bedefined for each application and/or between sender andrecipient.ctl-Y2519EMEND OF MEDIUMA control character that may be used to identify the physicalend of a medium, or the end of the used portion of a medium, or theend of the wanted portion of data recorded on a medium. Theposition of this character does not necessarily correspond to thephysical end of the medium.ctl-Z261ASUBSUBSTITUTEA control character used in the place of a character that hasbeen found to be invalid or in error. SUB is intended to beintroduced by automatic means.ctl-[271BESCESCAPEA control character which is used to provide additional controlfunctions. It alters the meaning of a limited number ofcontiguously following bit combinations. The use of this characteris specified in International Standard ISO 2022.ctl-\281CFSFILE SEPARATORA control character used to separate and qualify datalogically; its specific meaning has to be specified for eachapplication. If this character is used in hierarchical order, itdelimits a data item called a file.ctl-]291DGSGROUP SEPARATORA control character used to separate and qualify datalogically; its specific meaning has to be specified for eachapplication. If this character is used in hierarchical order, itdelimits a data item called agroup.ctl-^301ERSRECORD SEPARATORA control character used to separate and qualify datalogically; its specific meaning has to be specified for eachapplication. If this character is used in hierarchical order, itdelimits a data item called arecord.ctl-_311FUSUNIT SEPARATORA control character used to separate and qualify datalogically; its specific meaning has to be specified for eachapplication. If this character is used in hierarchical order, itdelimits a data item called aunit1277FDELDELETE(notdefined)

Notes:

  • The first column shows the widely used "control-something" nameused 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 C0of ISO 646 quotes the definition in thatdocument, with typos fixed, and with references to characters andcode positions changed to use Unicode names and modern terms.

Historical table

The following table lists the original names of Ascii control codesas defined in 1963.

code pos.Ascii 1963dec.hex.abbr.name00NULLNull/Idle11SOMStart of message22EOAEnd of address33EOMEnd of message44EOTEnd of transmission55WRU"Who are you...?"66RU"Are you...?"77BELLAudible signal88FE0Format effector99HT/SKHorizontal tabulation/ Skip (punched card)10ALFLine feed11BVTABVertical tabulation12CFFForm feed13DCRCarriage return14ESOShift out15FSIShift in1610DC0Device control reserved for data link escape1711DC1Device control1812DC21913DC32014DC4 (STOP)Device control (stop)2115ERRError2216SYNCSynchronous idle2317LEMLogical end of media2418S0Separator (information)2519S1261AS2271BS3281CS4291DS5301ES6311FS71277FDELDelete/idle

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


Note: The spacecharacter (blank, Ascii code position 32) isnot discussed here. It can be classified and processed as a graphiccharacter, or as a control character, or both, depending oncontext.

Sources:

  • American Standard Code for InformationInterchange ASA standard X3.4-1963("Ascii 1963"); notethat it allocated ACK to code position 124 and ESC to code position126
  • C0 Set of ISO646 in International Register of CodedCharacter Sets To Be Used With Escape Sequences
  • The Unicode Standard.

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

Jukka Korpela
原创粉丝点击