1、Standard ECMA-356th Edition - December 1994Standardizing Information and Communication SystemsPhone: +41 22 849.60.00 - Fax: +41 22 849.60.01 - X.400: C=ch; A=arcom, P=ecma, O=genevanet, OU1=ecma, S=helpdesk - Internet: HelpdeskECMA.CHCharacter Code Structure andExtension TechniquesStandard ECMA-356
2、th Edition - December 1994Standardizing Information and Communication SystemsPhone: +41 22 849.60.00 - Fax: +41 22 849.60.01 - X.400: C=ch; A=arcom, P=ecma, O=genevanet, OU1=ecma, S=helpdesk - Internet: HelpdeskECMA.CHIW-ECMA-035.DOC - 19.01.95 17,04Character Code Structure andExtension TechniquesBr
3、ief HistoryECMA/TC1 participates very actively in the work of JTC1/SC2 (previously ISO/TC97/SC2) on code structure and codeextension, and contributed numerous technical papers to SC2/WG1, the group entrusted with the preparation of ISO 2022, theInternational Standard for code extension techniques. E
4、CMA published its first Standard ECMA-35 on the same subject in1971. Three further editions in 1980, 1982 and 1985 reflected the progress achieved internationally, and the text of the 1985edition was identical with that of the 1986 edition of ISO 2022.The present edition is technically almost identi
5、cal with the 1985 edition of Standard ECMA-35 but is completely rearrangedand rewritten to make it more convenient to use as a reference document. The present edition of Standard ECMA-35 is fullyidentical with the 1994 edition of ISO/IEC 2022.Adopted as 6th edition of Standard ECMA-35 by the General
6、 Assembly of December 1994.- i -Table of contentsSection 1 - General 11 Scope 12 Conformance 22.1 Types of conformance 22.2 Conformance of information interchange 22.3 Conformance of devices 22.3.1 Device description 22.3.2 Originating devices 22.3.3 Receiving devices 23 References 34 Definitions 34
7、.1 bit combination 34.2 byte 34.3 character 34.4 coded-character-data-element (CC-data-element) 34.5 coded character set; code 44.6 code extension 44.7 code table 44.8 combining character 44.9 control character 44.10 control function 44.11 to designate 44.12 device 44.13 escape sequence 44.14 Final
8、Byte 44.15 graphic character 44.16 graphic symbol 54.17 Intermediate Byte 54.18 to invoke 54.19 repertoire 54.20 to represent 54.21 user 55 Notation, code tables and names 55.1 Notation 55.2 Code tables 65.3 Names of characters 6Section 2 - Character sets and codes 66 Characters and character sets 6
9、6.1 Types of characters and character sets 66.2 Fixed coded characters 76.2.1 Character DELETE 76.2.2 Character ESCAPE 76.2.3 Character SPACE 7- ii -6.3 Sets of coded graphic characters 76.3.1 Types of coded graphic character set 76.3.2 Contents of a coded graphic character set 106.3.3 Combination o
10、f graphic characters 106.3.4 Sources of coded graphic character sets 106.4 Sets of coded control functions 106.4.1 Types of coded control function set 106.4.2 Primary sets of coded control functions 116.4.3 Supplementary sets of coded control functions 116.4.4 Sources of coded control function sets
11、116.5 Coded single additional control functions 126.5.1 Standardized single control functions 126.5.2 Registered single control functions 126.5.3 Private control functions 126.5.4 Sources of coded single control functions 127 The elements of 8-bit and 7-bit codes 137.1 Summary of the elements 137.2
12、Character-set code elements 137.3 Invocation of character-set code elements 147.4 Coded code-identification functions 157.5 Unique coding of graphic characters 158 Structure of 8-bit codes 158.1 Code table layout for 8-bit codes 158.2 Elements and structure of the code 168.3 Invocation of graphic ch
13、aracter sets by means of shift functions 178.3.1 LOCKING-SHIFT ZERO, ONE, TWO, and THREE 178.3.2 LOCKING SHIFT ONE RIGHT, TWO RIGHT , and THREE RIGHT 178.3.3 Shift status 178.3.4 Interactions of locking-shift functions 198.4 Invocation of single graphic characters by means of shift functions 198.5 I
14、nvocation of sets of control functions 198.5.1 Invocation of the C0 code element 198.5.2 Invocation of the C1 code element 199 Structure of 7-bit codes 209.1 Code table layout for 7-bit codes 209.2 Elements and structure of the code 219.3 Invocation of graphic character sets by means of shift functi
15、ons 239.3.1 SHIFT-IN, SHIFT-OUT, LOCKING-SHIFT TWO, and LOCKING-SHIFT THREE 239.3.2 LOCKING SHIFT ONE RIGHT, TWO RIGHT, and THREE RIGHT 239.3.3 Shift status 239.3.4 Interactions of locking-shift functions 239.4 Invocation of single graphic characters by means of shift functions 239.5 Invocation of s
16、ets of control functions 249.5.1 Invocation of the C0 code element 249.5.2 Invocation of the C1 code element 2410 Versions and levels of implementation 24- iii -10.1 Versions 2410.2 Identification of code structure facilities and character sets 2410.3 Levels of implementation 2510.3.1 8-bit codes 25
17、10.3.2 Qualification of levels for 8-bit codes 2610.3.3 7-bit codes 2611 Transformation between 8-bit and 7-bit codes 2711.1 Transformation from 8-bit to 7-bit codes 2711.2 Transformation from 7-bit to 8-bit codes 27Section 3 - Code identification and escape sequences 2812 Code-identification functi
18、ons 2812.1 Purposes of code-identification functions 2812.2 Relationship to escape sequences 2813 Structure and use of escape sequences 2813.1 Structure of escape sequences 2813.2 Types of escape sequences 2913.2.1 Indication of type 2913.2.2 Escape Sequences of types nF 2913.2.3 Escape Sequences of
19、 type 4F 3013.2.4 Summary 3113.2.5 Notation of escape sequences 3113.3 Specific meanings of escape sequences 3213.3.1 Registration of Final Bytes 3213.3.2 Final Bytes specified in this Standard 3313.3.3 Private use 3314 Designation of sets of graphic characters and control functions 3314.1 Designati
20、on functions 3314.2 Designation of sets of control functions (CZD, C1D) 3414.2.1 Purpose 3414.2.2 Designation of C0 3414.2.3 Designation of C1 3414.3 Designation of sets of graphic characters (GnDm and GnDMm) 3414.3.1 Purpose 3414.3.2 Specifications 3514.3.3 Size indication for multiple-byte sets 36
21、14.4 Dynamically redefinable character sets (DRCS) 3614.4.1 Purpose 3614.4.2 Specification 3614.5 Identification of revisions of registered character sets (IRR) 3614.5.1 Purpose 3614.5.2 Specification 3715 Code announcement and switching 3715.1 Summary of functions provided 37- iv -15.2 Announcement
22、 of code structure facilities (ACS) 3715.2.1 Purpose 3715.2.2 Specification 3715.3 Data Delimiter for this Coding Method (CMD) 4215.3.1 Purpose 4215.3.2 Specification 4215.4 Designation of Other Coding Systems (DOCS) 4215.4.1 Purpose 4215.4.2 Specification 43Annex A -External references to character
23、 repertoires and their coding 44Annex B -The ISO International register of coded character sets to be used with escape sequences 48Annex C - Main differences between the 4th edition (1985) and the present edition of this Standard 50Annex D - Main differences between the 5th edition (1993) and the pr
24、esent edition of this Standard 51Section 1 - General1 ScopeThis Standard specifies the structure of 8-bit codes and 7-bit codes which provide for the coding of character sets. Thecode elements used in the structure are common to both the 8-bit and 7-bit codes. The codes use a variety oftechniques fo
25、r extending the capabilities of elementary 8-bit and 7-bit codes. Greater emphasis is given to 8-bit codesin this edition of the Standard than in previous editions because they are now more widely used.The use of common elements in the 8-bit and 7-bit code structure enables any specific conforming 8
26、-bit code to betransformed into an equivalent 7-bit code, and vice versa, in a simple and direct fashion.ECMA-43 conforms to the 8-bit code structure specified here, and ECMA-6 conforms to the 7-bit code structurespecified here.NOTE 1The coded character set specified in ISO/IEC 10646-1 has a differe
27、nt structure not in accordance with this Standard.The code structure facilities specified here include various means of extending the number of control functions andgraphic characters available in a code. They also include techniques to construct and formalize the definition ofspecific codes, and to
28、 provide a coded identification of the structure and of the constituent elements of such specificcodes.Specific codes may also be identified by means of object identifiers in accordance with ISO 8824, Abstract SyntaxNotation One (ASN.1). The form of such object identifiers is specified in annex A.In
29、dividual character sets and control functions intended for use with these 8-bit and 7-bit codes are assumed to beregistered in the ISO International Register of Coded Character Sets to be Used with Escape Sequences, in accordancewith ISO 2375 (see annex B). The register includes details to relate in
30、dividual character sets and control functionswith their coded representations, and also with the associated coded identifications of such character sets.The principles established in this Standard may be utilized to form supplementary code structure facilities. Forexample ECMA-48 has followed such a
31、 procedure to formulate some parameterized control functions.The use of uniform code structure techniques for the 8-bit and 7-bit codes specified here has the advantage of: permitting uniform provision for code structure in the design of information processing systems, providing standardized methods
32、 of calling into use agreed sets of characters, allowing the interchange of data between environments that utilise 8-bit and 7-bit codes respectively, reducing the risk of conflict between systems required to inter-operate.When two systems with different levels of implementation of code structure fa
33、cilities are required to communicatewith one another, they may do so using the code structure facilities that they have in common.The codes specified here are designed to be used for data that is processed sequentially in a forward direction. Use ofthese codes in strings of data which are processed
34、in some other way, or which are included in data formatted forfixed-length record processing, may have undesirable results or may require additional special treatment to ensurecorrect interpretation.NOTE 2Since the fourth edition (1985) of this Standard the text has been completely rearranged and re
35、written to make theStandard more convenient to use as a reference document. The fifth edition is arranged in three main sections asfollows:1 General2 Character Sets and Codes3 Code Identification and Escape SequencesThe sixth edition of this Standard is fully identical with International Standard IS
36、O/IEC 2022:1994.- 2 -2 Conformance2.1 Types of conformanceFull conformance to a standard means that all of its requirements are met. Conformance will only have a uniquemeaning if the standard contains no options. If there are options within the standard they must be clearly identified,and any claim
37、of conformance must include a statement that identifies those options that have been adopted.This Standard is of a different nature since it specifies a large number of facilities from which different selectionsmay be made to suit individual applications. These selections are not identified in this
38、Standard, but must beidentified at the time that a claim of conformance is made. Conformance to such an identified selection is known aslimited conformance.The selection of facilities from this Standard that are to be used in a particular application will generally beincluded in a specification docu
39、ment, which states the adopted facilities and gives other details necessary to definefully one or more specific codes. Such a specification is said to be in accordance with this Standard (see 10.1).2.2 Conformance of information interchangeA CC-data-element within coded information for interchange i
40、s in conformance with this Standard if the codedrepresentations within that CC-data-element satisfy the following conditions:a) they shall represent graphic characters, control functions, and code-identification functions in accordance withan identified selection of the facilities specified in this
41、Standard (i.e. a version of this Standard, see 10.1);b) when the code extension techniques specified in this Standard are used, they shall be implemented by thecontrol functions and code-identification functions defined in this Standard with the meaning and codedrepresentation specified in this Stan
42、dard;c) no coded representation that is either reserved for registration and not assigned, or reserved for future use, shallbe used;d) no registered escape sequence shall be used with a meaning different from that defined by the registration.2.3 Conformance of devicesA device is in conformance with
43、this Standard if it conforms to the requirements of 2.3.1, and either or both of2.3.2 and 2.3.3 below. Any claim of conformance shall identify the document which contains the descriptionspecified in 2.3.1.2.3.1 Device descriptionA device that conforms to this Standard shall be the subject of a descr
44、iption thata) identifies either directly, or by reference to a specification that is in accordance with this Standard, theselection of facilities from this Standard that it can utilize when originating or when receiving CC-data-elements;b) identifies the means by which the user may supply the corres
45、ponding characters and functions, or mayrecognize them when they are made available to the user, as specified in 2.3.2 and 2.3.3 respectively.2.3.2 Originating devicesAn originating device shall be capable of transmitting within a CC-data-element the coded representations ofgraphic characters from o
46、ne or more graphic character sets, and of an identified selection of control functionsand code-identification functions conforming to this Standard.Such a device shall allow the user to supply, from an appropriate set, characters or other indications which willimplicitly or explicitly determine the
47、graphic characters, control functions, and code-identification functionswhose coded representations are to be transmitted.2.3.3 Receiving devicesA receiving device shall be capable of receiving within a CC-data-element and interpreting the codedrepresentations of graphic characters from one or more
48、graphic character sets, and an identified selection ofcontrol functions and code-identification functions conforming to this Standard.- 3 -Such a device shall make available to the user, from an appropriate set, characters or other indications which areimplicitly or explicitly determined by the grap
49、hic characters, control functions, and code-identification functionswhose coded representations are received.3 ReferencesECMA-6:1991 7-bit Coded Character SetECMA-43:1991 8-bit Coded Character Set Structure and RulesECMA-48:1991 Control Functions for Coded Character SetsECMA-94:1986 8-bit Single-byte Coded Graphic Character Sets - Latin Alphabets No. 1 to No. 4ISO 2375:1985 Data processing - Procedure for Registration of Escape SequencesISO 7498:1984 Information processing systems - Open Systems Interconnection - Basic Reference ModelISO 8824:1 Information technology - Open Systems I