1、Information technology The JSON data interchange syntaxTechnologies de linformation Syntaxe dchange de donnes JSONINTERNATIONAL STANDARDISO/IEC21778Reference numberISO/IEC 21778:2017(E)First edition2017-11 ISO/IEC 2017 ii ISO/IEC 2017 All rights reservedCOPYRIGHT PROTECTED DOCUMENT ISO/IEC 2017,Publ
2、ished in SwitzerlandAll rights reserved.Unless otherwise specified,no part of this publication may be reproduced or utilized otherwise in any form or by any means,electronic or mechanical,including photocopying,or posting on the internet or an intranet,without prior written permission.Permission can
3、 be requested from either ISO at the address below or ISOs member body in the country of the requester.ISO copyright officeCh.de Blandonnet 8 CP 401CH-1214 Vernier,Geneva,SwitzerlandTel.+41 22 749 01 11Fax+41 22 749 09 47copyrightiso.orgwww.iso.orgISO/IEC 21778:2017(E)ISO/IEC 21778:2017(E)Foreword.i
4、vIntroduction.v1 Scope.12 Conformance.13 Normative References.14 JSON Text.15 JSON Values.26 Objects.27 Arrays.38 Numbers.39 String.4Bibliography.6 ISO/IEC 2017 All rights reserved iiiContents Page ISO/IEC 21778:2017(E)ForewordISO(the International Organization for Standardization)and IEC(the Intern
5、ational Electrotechnical Commission)form the specialized system for worldwide standardization.National bodies that are members of ISO or IEC participate in the development of International Standards through technical committees established by the respective organization to deal with particular field
6、s of technical activity.ISO and IEC technical committees collaborate in fields of mutual interest.Other international organizations,governmental and non-governmental,in liaison with ISO and IEC,also take part in the work.In the field of information technology,ISO and IEC have established a joint tec
7、hnical committee,ISO/IEC JTC 1.The procedures used to develop this document and those intended for its further maintenance are described in the ISO/IEC Directives,Part 1.In particular the different approval criteria needed for the different types of document should be noted.This document was drafted
8、 in accordance with the editorial rules of the ISO/IEC Directives,Part 2(see www.iso.org/directives).Attention is drawn 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 r
9、ights.Details of any patent rights identified during the development of the document will be in the Introduction and/or on the ISO list of patent declarations received(see www.iso.org/patents).Any trade name used in this document is information given for the convenience of users and does not constit
10、ute an endorsement.For an explanation on the voluntary nature of standards,the meaning of ISO specific terms and expressions related to conformity assessment,as well as information about ISOs adherence to the World Trade Organization(WTO)principles in the Technical Barriers to Trade(TBT)see the foll
11、owing URL:www.iso.org/iso/foreword.html.ISO/IEC 21778 was prepared by Ecma International(as ECMA404)and was adopted,under a special fasttrack procedure,by Joint Technical Committee ISO/IEC JTC 1,Information technology,in parallel with its approval by national bodies of ISO and IEC.iv ISO/IEC 2017 Al
12、l rights reserved ISO/IEC 21778:2017(E)IntroductionJSON1)is a text syntax that facilitates structured data interchange between all programming languages.JSON is a syntax of braces,brackets,colons,and commas that is useful in many contexts,profiles,and applications.JSON stands for JavaScript Object N
13、otation and was inspired by the object literals of JavaScript aka ECMAScript as defined in the ECMAScript Language Specification,Third Edition.1 However,it does not attempt to impose ECMAScripts internal data representations on other programming languages.Instead,it shares a small subset of ECMAScri
14、pts syntax with all other programming languages.The JSON syntax is not a specification of a complete data interchange.Meaningful data interchange requires agreement between a producer and consumer on the semantics attached to a particular use of the JSON syntax.What JSON does provide is the syntacti
15、c framework to which such semantics can be attachedJSON syntax describes a sequence of Unicode code points.JSON also depends on Unicode in the hex numbers used in the u escapement notation.JSON is agnostic about the semantics of numbers.In any programming language,there can be a variety of number ty
16、pes of various capacities and complements,fixed or floating,binary or decimal.That can make interchange between different programming languages difficult.JSON instead offers only the representation of numbers that humans use:a sequence of digits.All programming languages know how to make sense of digit sequences even if they disagree on internal representations.That is enough to allow interchange.Programming languages vary widely on whether they support objects,and if so,what characteristics and