1、BRITISH STANDARD BS ISO/IEC 2022:1994 Implementation of ISO/IEC 2022:1994 Information technology Character code structure and extensiontechniquesBSISO/IEC2022:1994 BSI 04-2000 ISBN 0 580 23914 4 National foreword This British Standard reproduces verbatim ISO2022:1994 and implements it as the UK nati
2、onal standard. It supersedes BS6856:1987 which is withdrawn. This British Standard is published under the direction of the Information Systems Technology Assembly whose Technical Committee IST/2 has the responsibility to: aid enquirers to understand the text; present to the responsible international
3、 committee any enquiries on interpretation, or proposals for change, and keep UK interests informed; monitor related international and European developments and promulgate them in the UK. NOTEInternational and European Standards, as well as overseas standards, are available from Customer Services, B
4、SI,389 Chiswick High Road, London WA4AL. A British Standard does not purport to include all the necessary provisions of a contract. Users of British Standards are responsible for their correct application. Compliance with a British Standard does not of itself confer immunity from legal obligations.
5、Summary of pages This document comprises a front cover, an inside front cover, pages i and ii, theISO/IEC title page, pages ii to vi, pages 1 to 43 and a back cover. This standard has been updated (see copyright date) and may have had amendments incorporated. This will be indicated in the amendment
6、table on the inside front cover. Amendments issued since publication Amd. No. Date CommentsBSISO/IEC2022:1994 BSI 04-2000 i Contents Page National foreword Inside front cover Foreword vi Text of ISO/IEC 2022 1ii blankISO/IEC2022:1994(E) ii BSI 04-2000 Contents Page Foreword vi Section 1. General 1 S
7、cope 1 2 Conformance 1 2.1 Types of conformance 1 2.2 Conformance of information interchange 2 2.3 Conformance of devices 2 2.3.1 Device description 2 2.3.2 Originating devices 2 2.3.3 Receiving devices 2 3 Normative references 3 4 Definitions 3 4.1 bit combination 3 4.2 byte 3 4.3 character 3 4.4 c
8、oded-character-data-element (CC-data-element) 3 4.5 coded character set; code 3 4.6 code extension 3 4.7 code table 3 4.8 combining character 3 4.9 control character 4 4.10 control function 4 4.11 to designate 4 4.12 device 4 4.13 escape sequence 4 4.14 Final Byte 4 4.15 graphic character 4 4.16 gra
9、phic symbol 4 4.17 Intermediate Byte 4 4.18 to invoke 4 4.19 repertoire 4 4.20 to represent 4 4.21 user 5 5 Notation, code tables and names 5 5.1 Notation 5 5.2 Code tables 5 5.3 Names of characters 6 Section 2. Character sets and codes 6 Characters and character sets 7 6.1 Types of characters and c
10、haracter sets 7 6.2 Fixed coded characters 7 6.2.1 Character DELETE 7 6.2.2 Character ESCAPE 7 6.2.3 Character SPACE 7 6.3 Sets of coded graphic characters 7 6.3.1 Types of coded graphic character set 7 6.3.2 Contents of a coded graphic character set 8 6.3.3 Combination of graphic characters 8 6.3.4
11、 Sources of coded graphic character sets 10ISO/IEC2022:1994(E) BSI 04-2000 iii Page 6.4 Sets of coded control functions 10 6.4.1 Types of coded control function set 10 6.4.2 Primary sets of coded control functions 11 6.4.3 Supplementary sets of coded control functions 11 6.4.4 Sources of coded contr
12、ol function sets 11 6.5 Coded single additional control functions 11 6.5.1 Standardized single control functions 11 6.5.2 Registered single control functions 11 6.5.3 Private control functions 11 6.5.4 Sources of coded single control functions 12 7 The elements of 8-bit and 7-bit codes 12 7.1 Summar
13、y of the elements 12 7.2 Character-set code elements 12 7.3 Invocation of character-set code elements 13 7.4 Coded code-identification functions 14 7.5 Unique coding of graphic characters 14 8 Structure of 8-bit codes 14 8.1 Code table layout for 8-bit codes 14 8.2 Elements and structure of the code
14、 15 8.3 Invocation of graphic character sets by means of shift functions 15 8.3.1 LOCKING-SHIFT ZERO,ONE, TWO, and THREE 15 8.3.2 LOCKING SHIFT ONE RIGHT,TWO RIGHT, andTHREE RIGHT 16 8.3.3 Shift status 16 8.3.4 Interactions of locking-shift functions 16 8.4 Invocation of single graphic characters by
15、 means of shift functions 16 8.5 Invocation of sets of control functions 18 8.5.1 Invocation of the C0 code element 18 8.5.2 Invocation of the C1 code element 18 9 Structure of 7-bit codes 18 9.1 Code table layout for 7-bit codes 18 9.2 Elements and structure of the code 19 9.3 Invocation of graphic
16、 character sets by means of shift functions 21 9.3.1 SHIFT-IN, SHIFT-OUT, LOCKING-SHIFT TWO, and LOCKING-SHIFT THREE 21 9.3.2 LOCKING SHIFT ONE RIGHT, TWO RIGHT, and THREE RIGHT 21 9.3.3 Shift status 21 9.3.4 Interactions of locking-shift functions 21 9.4 Invocation of single graphic characters by m
17、eans of shift functions 21 9.5 Invocation of sets of control functions 22 9.5.1 Invocation of the C0 code element 22 9.5.2 Invocation of the C1 code element 22ISO/IEC2022:1994(E) iv BSI 04-2000 Page 10 Versions and levels of implementation 22 10.1 Versions 22 10.2 Identification of code structure fa
18、cilities and character sets 22 10.3 Levels of implementation 23 10.3.1 8-bit codes 23 10.3.2 Qualification of levels for 8-bit codes 23 10.3.3 7-bit codes 24 11 Transformation between 8-bit and 7-bit codes 24 11.1 Transformation from 8-bit to 7-bit codes 24 11.2 Transformation from 7-bit to 8-bit co
19、des 25 Section 3. Code identification and escape sequences 12 Code-identification functions 26 12.1 Purposes of code-identification functions 26 12.2 Relationship to escape sequences 26 13 Structure and use of escape sequences 26 13.1 Structure of escape sequences 26 13.2 Types of escape sequences 2
20、6 13.2.1 Indication of type 26 13.2.2 Escape Sequences of types nF 27 13.2.3 Escape Sequences of type 4F 28 13.2.4 Summary 28 13.2.5 Notation of escape sequences 28 13.3 Specific meanings of escape sequences 30 13.3.1 Registration of Final Bytes 30 13.3.2 Final Bytes specified in this International
21、Standard 30 13.3.3 Private use 30 14 Designation of sets of graphic characters and control functions 30 14.1 Designation functions 30 14.2 Designation of sets of control functions (CZD, C1D) 31 14.2.1 Purpose 31 14.2.2 Designation of C0 31 14.2.3 Designation of C1 31 14.3 Designation of sets of grap
22、hic characters (GnDm and GnDMm) 31 14.3.1 Purpose 31 14.3.2 Specifications 32 14.3.3 Size indication for multiple-byte sets 33 14.4 Dynamically redefinable character sets (DRCS) 33 14.4.1 Purpose 33 14.4.2 Specification 33 14.5 Identification of revisions of registered character sets (IRR) 33 14.5.1
23、 Purpose 33 14.5.2 Specification 33 15 Code announcement and switching 34 15.1 Summary of functions provided 34 15.2 Announcement of code structure facilities (ACS) 34 15.2.1 Purpose 34 15.2.2 Specification 34ISO/IEC2022:1994(E) BSI 04-2000 v Page 15.3 Data Delimiter for this Coding Method (CMD) 38
24、15.3.1 Purpose 38 15.3.2 Specification 38 15.4 Designation of Other Coding Systems (DOCS) 38 15.4.1 Purpose 38 15.4.2 Specification 38 Annex A (normative) External references to character repertoires and their coding 39 Annex B (informative) The ISO International register of coded character sets to
25、be used with escape sequences 41 Annex C (informative) Main differences between the 3rd edition (1986) and the present edition of this International Standard 42 Annex D (informative) Bibliography 43 Figure 1 Code tables 6 Figure 2 Structure of sets of coded graphic characters 9 Figure 3 Structure of
26、 sets of coded control functions (or characters) 10 Figure 4 Elements of a code 12 Figure 5 Areas of 8-bit code table 15 Figure 6 Structure of 8-bit codes 17 Figure 7 Areas of 7-bit code table 19 Figure 8 Structure of 7-bit codes 20 Table 1 Character-set code elements 13 Table 2 Shift functions 13 T
27、able 3.a Types of escape sequence and corresponding indicators 27 Table 3.b Escape sequences of type nF and corresponding functions 27 Table 4 Escape sequences of type 4F and corresponding functions 28 Table 5 Intermediate bytes of escape sequences 29 Table 6 Designation functions for graphic charac
28、ter sets 32 Table 7 Code Structure Facilities for the Announcer Function (ACS) 35ISO/IEC2022:1994(E) vi BSI 04-2000 Foreword ISO (the International Organisation for Standardisation) and IEC (the International Electrical Commission) form the specialised system for world-wide standardisation. National
29、 Bodies that are members of ISO or IEC participate in the development of International Standards through technical committees established by the respective organisation to deal with particular fields of mutual interest. Other international organisations, governmental and non-governmental, in liaison
30、 with ISO and IEC, also take part in the work. In the field of information technology, ISO and IEC have established a joint technical committee ISO/IEC JTC1. Draft International Standards adopted by the joint technical committee are circulated to national bodies for voting. Publication as an Interna
31、tional Standard requires approval by at least75% of the national bodies casting a vote. International Standard ISO/IEC2022 was prepared by the European Association for the Standardization of Information and Communication Systems, ECMA, (asECMA-35) and was adopted, under a special “fast-track procedu
32、re”, by Joint Technical Committee ISO/IEC JTC1, Information technology, in parallel with its approval by national bodies of ISO and IEC. This fourth edition cancels and replaces the third edition (ISO2022:1986), of which it constitutes a technical revision (see also the introduction). Annex A forms
33、an integral part of this International Standard. Annex B, Annex C and Annex D are for information only.ISO/IEC2022:1994(E) BSI 04-2000 1 Section 1. General 1 Scope This International Standard specifies the structure of8-bit codes and7-bit codes which provide for the coding of character sets. The cod
34、e elements used in the structure are common to both the8-bit and7-bit codes. The codes use a variety of techniques for extending the capabilities of elementary8-bit and7-bit codes. Greater emphasis is given to8-bit codes in this edition of the Standard than in previous editions because they are now
35、more widely used. The use of common elements in the8-bit and7-bit code structure enables any specific conforming 8-bit code to be transformed into an equivalent7-bit code, and vice versa, in a simple and direct fashion. ISO/IEC 4873 conforms to the8-bit code structure specified here, and ISO/IEC646
36、conforms to the7-bit code structure specified here. NOTEThe coded character set specified in ISO/IEC10646-1 has a different structure not in accordance with this International Standard. The code structure facilities specified here include various means of extending the number of control functions an
37、d graphic characters available in a code. They also include techniques to construct and formalize the definition of specific codes, and to provide a coded identification of the structure and of the constituent elements of such specific codes. Specific codes may also be identified by means of object
38、identifiers in accordance with ISO8824, Abstract Syntax Notation One (ASN.1). The form of such object identifiers is specified in Annex A. Individual character sets and control functions intended for use with these8-bit and7-bit codes are assumed to be registered in the ISO International Register of
39、 Coded Character Sets to be Used with Escape Sequences, in accordance with ISO2375 (see Annex B). The register includes details to relate individual character sets and control functions with their coded representations, and also with the associated coded identifications of such character sets. The p
40、rinciples established in this International Standard may be utilized to form supplementary code structure facilities. For example ISO/IEC6429 has followed such a procedure to formulate some parameterized control functions. The use of uniform code structure techniques for the 8-bit and 7-bit codes sp
41、ecified here has the advantage of: permitting uniform provision for code structure in the design of information processing systems, providing standardized methods of calling into use agreed sets of characters, allowing the interchange of data between environments that utilise 8-bit and 7-bit codes r
42、espectively, reducing the risk of conflict between systems required to inter-operate. When two systems with different levels of implementation of code structure facilities are required to communicate with one another, they may do so using the code structure facilities that they have in common. The c
43、odes specified here are designed to be used for data that is processed sequentially in a forward direction. Use of these codes in strings of data which are processed in some other way, or which are included in data formatted for fixed-length record processing, may have undesirable results or may req
44、uire additional special treatment to ensure correct interpretation. NOTESince the previous edition (1986) of this International Standard the text has been completely rearranged and rewritten to make the Standard more convenient to use as a reference document. It is now arranged in three main section
45、s as follows: 1 General 2 Character Sets and Codes 3 Code Identification and Escape Sequences 2 Conformance 2.1 Types of conformance Full conformance to a standard means that all of its requirements are met. Conformance will only have a unique meaning if the standard contains no options. If there ar
46、e options within the standard they must be clearly identified, and any claim of conformance must include a statement that identifies those options that have been adopted.ISO/IEC2022:1994(E) 2 BSI 04-2000 This International Standard is of a different nature since it specifies a large number of facili
47、ties from which different selections may be made to suit individual applications. These selections are not identified in this International Standard, but must be identified at the time that a claim of conformance is made. Conformance to such an identified selection is known as limited conformance. T
48、he selection of facilities from this International Standard that are to be used in a particular application will generally be included in a specification document, which states the adopted facilities and gives other details necessary to define fully one or more specific codes. Such a specification i
49、s said to be in accordance with this International Standard (see10.1). 2.2 Conformance of information interchange A CC-data-element within coded information for interchange is in conformance with this International Standard if the coded representations within that CC-data-element satisfy the following conditions: a) they shall represent graphic characters, control functions, and code-identification functions in accordance with an identified selection of the facilities specified in this International Standard (i.e.aversion of this