ISO IEC 14957-2010 Information technology - Representation of data element values - Notation of the format《信息技术 数据元值表示法 格式表示法》.pdf

上传人:ownview251 文档编号:1256871 上传时间:2019-09-02 格式:PDF 页数:10 大小:255.50KB
下载 相关 举报
ISO IEC 14957-2010 Information technology - Representation of data element values - Notation of the format《信息技术 数据元值表示法 格式表示法》.pdf_第1页
第1页 / 共10页
ISO IEC 14957-2010 Information technology - Representation of data element values - Notation of the format《信息技术 数据元值表示法 格式表示法》.pdf_第2页
第2页 / 共10页
ISO IEC 14957-2010 Information technology - Representation of data element values - Notation of the format《信息技术 数据元值表示法 格式表示法》.pdf_第3页
第3页 / 共10页
ISO IEC 14957-2010 Information technology - Representation of data element values - Notation of the format《信息技术 数据元值表示法 格式表示法》.pdf_第4页
第4页 / 共10页
ISO IEC 14957-2010 Information technology - Representation of data element values - Notation of the format《信息技术 数据元值表示法 格式表示法》.pdf_第5页
第5页 / 共10页
点击查看更多>>
资源描述

1、 Reference number ISO/IEC 14957:2010(E) ISO/IEC 2010INTERNATIONAL STANDARD ISO/IEC 14957 Second edition 2010-12-15 Information technology Representation of data element values Notation of the format Technologies de linformation Reprsentation des valeurs des lments de donnes Notation du format ISO/IE

2、C 14957:2010(E) PDF disclaimer This PDF file may contain embedded typefaces. In accordance with Adobes licensing policy, this file may be printed or viewed but shall not be edited unless the typefaces which are embedded are licensed to and installed on the computer performing the editing. In downloa

3、ding this file, parties accept therein the responsibility of not infringing Adobes licensing policy. The ISO Central Secretariat accepts no liability in this area. Adobe is a trademark of Adobe Systems Incorporated. Details of the software products used to create this PDF file can be found in the Ge

4、neral Info relative to the file; the PDF-creation parameters were optimized for printing. Every care has been taken to ensure that the file is suitable for use by ISO member bodies. In the unlikely event that a problem relating to it is found, please inform the Central Secretariat at the address giv

5、en below. COPYRIGHT PROTECTED DOCUMENT ISO/IEC 2010 All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized in any form or by any means, electronic or mechanical, including photocopying and microfilm, without permission in writing from either ISO at

6、 the address below or ISOs member body in the country of the requester. ISO copyright office Case postale 56 CH-1211 Geneva 20 Tel. + 41 22 749 01 11 Fax + 41 22 749 09 47 E-mail copyrightiso.org Web www.iso.org Published in Switzerland ii ISO/IEC 2010 All rights reservedISO/IEC 14957:2010(E) ISO/IE

7、C 2010 All rights reserved iiiForeword ISO (the International Organization for Standardization) and IEC (the International Electrotechnical Commission) form the specialized system for worldwide standardization. National bodies that are members of ISO or IEC participate in the development of Internat

8、ional Standards through technical committees established by the respective organization to deal with particular fields of technical activity. ISO and IEC technical committees collaborate in fields of mutual interest. Other international organizations, governmental and non-governmental, in liaison wi

9、th 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 JTC 1. International Standards are drafted in accordance with the rules given in the ISO/IEC Directives, Part 2. The main task of the joint technical

10、committee is to prepare International Standards. Draft International Standards adopted by the joint technical committee are circulated to national bodies for voting. Publication as an International Standard requires approval by at least 75 % of the national bodies casting a vote. Attention is drawn

11、to the possibility that some of the elements of this document may be the subject of patent rights. ISO and IEC shall not be held responsible for identifying any or all such patent rights. ISO/IEC 14957 was prepared by Joint Technical Committee ISO/IEC JTC 1, Information technology, Subcommittee SC 3

12、2, Data management and interchange. This second edition cancels and replaces the first edition (ISO/IEC 14957:1996), which has been technically revised. ISO/IEC 14957:2010(E) iv ISO/IEC 2010 All rights reservedIntroduction Data interchange is experiencing rapid expansion in the commercial, technical

13、 and public sectors. It gives rise to interworking between different communities which have often independently developed information processing applications and telecommunication networks to meet specific needs. Hence, the overall situation suffers from a lack of homogeneity. In order to remedy thi

14、s situation, an urgent standardization effort focused in particular on the representation of data elements is necessary. The representation of a data element supposes in the first place that the format, i.e. the types of character used in the representation and the length of the representation, is s

15、pecified. In order that these specifications have the same significance for everyone involved, it is necessary to express them in accordance with standardized conventions. Such rules are likely to eliminate any and all risk of ambiguity, lack of understanding and error; they also facilitate the comp

16、arison of data element dictionaries, the design and creation of information systems, and electronic data interchange (EDI). These notations have been partially and variously expressed in different International Standards according to the specific contexts in which they have been defined, e.g. EDIFAC

17、T (ISO 9735), banking standards (such as ISO 7982-1), character sets (ISO/IEC 8859), information processing (ISO 6093), and programming languages (ISO/IEC 9899). The objective of this International Standard is to provide a unique source of reference on this subject for all standards utilizing these

18、type of notations independently of their environments. INTERNATIONAL STANDARD ISO/IEC 14957:2010(E) ISO/IEC 2010 All rights reserved 1Information technology Representation of data element values Notation of the format 1 Scope This International Standard specifies the notation to be used for stating

19、the format, i.e. the character classes, used in the representation of data elements and the length of these representations. It also specifies additional notations relative to the representation of numerical figures. For example, this formatting technique might be used as part of the metadata for da

20、ta elements. The scope of this International Standard is limited to graphic characters, such as digits, letters and special characters. The scope is limited to the basic datatypes of characters, character strings, integers, reals, and pointers. 2 Normative references The following referenced documen

21、ts are indispensable for the application of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies. ISO/IEC 10646:2003, Information technology Universal Multiple-Octet Coded Charact

22、er Set (UCS) 3 Terms and definitions For the purposes of this document, the following terms and definitions apply. 3.1 data element unit of data that is considered, in context, to be indivisible ISO/IEC 2382-4:1999, 04.07.01 3.2 character set finite set of characters that is complete for a given pur

23、pose ISO/IEC 2382-4:1999, 04.01.02 3.3 character type set of characters of the same kind or having the same use EXAMPLE Letters, figures, special characters, etc. 3.4 length length of representation number of characters used to represent a data element ISO/IEC 14957:2010(E) 2 ISO/IEC 2010 All rights

24、 reserved4 Notation relative to character types and length of representation of a data element The format shall be a characterstring sequence. The format is composed of zero or more directives: one or more space characters as defined in ISO/IEC 10646:2003, Clause 20, an ordinary character (neither %

25、 nor a space character), or a conversion specification. Each conversion specification is introduced by the character %. NOTE This specification of formats is based upon the “fscanf()“ function in the C programming language (ISO/IEC 9899:1999). Conceptually, the format string implies a syntax process

26、or that consumes syntactic units, as described by the format directives. Because there is no service interface specified by this International Standard, there is no prescribed error handling for strings that do not match the formatting directives. After the %, the following appear in sequence: an op

27、tional assignment-suppressing character *; an optional nonzero decimal integer that specifies the maximum field width (in characters); an optional length modifier that specifies the size of the receiving object; a conversion specifier character that specifies the type of conversion to be applied. Ea

28、ch directive of the format is processed in turn. A directive composed of space character(s) is executed by reading input up to the first non-space character (which remains unread), or until no more characters can be read. A directive that is an ordinary character is executed by reading the next char

29、acters of the stream. If any of those characters differ from the ones composing the directive, the directive fails and the differing and subsequent characters remain unread. Similarly, if end-of-file, an encoding error, or a read error prevents a character from being read, the directive fails. A dir

30、ective that is a conversion specification defines a set of matching input sequences, as described below for each specifier. A conversion specification is executed in the following steps: Input space characters are skipped, unless the specification includes a , c, or n specifier. 1An input item is re

31、ad from the stream, unless the specification includes an n specifier. An input item is defined as the longest sequence of input characters which does not exceed any specified field width and which is, or is a prefix of, a matching input sequence. The first character, if any, after the input item rem

32、ains unread. If the length of the input item is zero, the execution of the directive fails. This condition is a matching failure unless end-of-file, an encoding error, or a read error prevented input from the stream, in which case it is an input failure. Except in the case of a % specifier, the inpu

33、t item (or, in the case of a %n directive, the count of input characters) is converted to a type appropriate to the conversion specifier. If the input item is not a matching sequence, the execution of the directive fails: this condition is a matching failure. Unless assignment suppression was indica

34、ted by a *, the result of the conversion is placed in the object pointed to by the first argument following the format argument that has not already received a conversion result. If this object does not have an appropriate type, or if the result of the conversion cannot be represented in the object,

35、 the behavior is undefined. 1 These space characters are not counted against a specified field width. ISO/IEC 14957:2010(E) ISO/IEC 2010 All rights reserved 3The conversion specifiers and their meanings are as follows. d matches an optionally signed decimal integer, whose format is the same as expec

36、ted for the subject sequence of the strtol() function with the value 10 for the base argument. Example: “%d“ matches “17“, but not “1.0“, “17H“, “ABC“; “%03d“ matches “017“, “000“, “017”, but not “1000“. Note: “%d0“ will not match any string. i matches an optionally signed integer, whose format is t

37、he same as expected for the subject sequence of the strtol() function with the value 0 for the base argument. Example: “%i“ matches “+17“, “17“, “-17“, but not “1.0“, “+17H“. o matches an optionally signed octal integer, whose format is the same as expected for the subject sequence of the strtoul()

38、function with the value 8 for the base argument. Example: “%o“ matches “0123“, “-456“, but not “0789“. u matches an optionally signed decimal integer, whose format is the same as expected for the subject sequence of the strtoul() function with the value 10 for the base argument. Example: “%u“ matche

39、s “17“, but not “+17“, “-17“. x matches an optionally signed hexadecimal integer, whose format is the same as expected for the subject sequence of the strtoul() function with the value 16 for the base argument. Example: “%x“ matches “013EF“, “-013ef“, but not “013EFG“. a,e,f,g match 2an optionally s

40、igned floating-point number, infinity, or NaN, whose format is the same as expected for the subject sequence of the strtod() function. The corresponding argument shall be a pointer to floating. Example: “%f“ matches “1.2E10“, “+1.2E+10“, “-1.2e-10“, “infinity, “nan“ but not “1.2F10“, “nan“. c matche

41、s a sequence of characters of exactly the number specified by the field width (1 if no field width is present in the directive). If length modifier is present, the input shall be a sequence of characters. Examples: “%c“ matches “X“ but not “XY“; “%2c“ matches “XY“. s matches a sequence of non-space

42、characters. If length modifier is present, the input shall be a sequence of characters. Examples: “%s“ matches “123abc“, “123abcd“, “ but not “123 abc“. matches a nonempty sequence of characters from a set of expected characters (the scanset). The conversion specifier includes all subsequent charact

43、ers in the format string, up to and including the matching right bracket (). The characters between the brackets (the scanlist) compose the scanset, unless the character after the left bracket is a circumflex (), in which case the scanset contains all characters that do not appear in the scanlist be

44、tween the circumflex and the right bracket. If the conversion specifier begins with or , the right bracket character is in the scanlist and the next following right bracket character is the matching right bracket that ends the specification; otherwise the first following right bracket character is t

45、he one that ends the specification. If a - character is in the scanlist and is not the first, nor the second where the first character is a , nor the last character, the behavior is implementation-defined. Examples: “abcad-f“ matches “abca“, “abcd“, “abce“, “abcf“, but not “abc“, “abcg“; “abcd-f“ ma

46、tches “abcg“ but not “abc“, “abcd“. % matches a single % character; no conversion occurs. The complete conversion specification shall be %. 2 There is no distinction among a, e, f, and g formats. ISO/IEC 14957:2010(E) 4 ISO/IEC 2010 All rights reservedAnnex A (informative) EBNF grammar for data elem

47、ent description The following syntax is based upon ISO/IEC 14977, Information technology Syntactic metalanguage Extended BNF. format_description = non_format_component , format_component , non_format_component; non_format_component = non_format_characters ; non_format_characters = ( ascii - “%“ ) |

48、“%“ ; format_component = signed_decimal_format | signed_integer_format | signed_octal_format | unsigned_integer_format | signed_hexadecimal_format | character_array_format | character_string_format | defined_character_set_format | real_number_format ; decimal_with_optinal_leading_zero = decimal_nume

49、ral , decimal_numeral ; decimal_numeral = “0“ | “1“ | “2“ | “3“ | “4“ | “5“ | “6“ | “7“ | “8“ | “9“ ; signed_decimal_format = “%“ , “+“ | “-“ , “*“ | decimal_with_optional_leading_zero , “d“ ; signed_integer_format = “%“ , “+“ | “-“ , “*“ | decimal_with_optional_leading_zero , “i“ ; signed_octal_format = “%“ , “+“ | “-“ , “*“ | decimal_with_optional_leading_zero , “o“ ; unsigned_integer_format = “%“ , “+“ | “-“ , “*“ | decimal_with_optional

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 标准规范 > 国际标准 > 其他

copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
备案/许可证编号:苏ICP备17064731号-1