Re: [Json] BOMs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Nov 19, 2013, at 10:18 PM, Martin J. Dürst wrote:

Hello Henry, others,

On 2013/11/20 3:55, Henry S. Thompson wrote:
Allen Wirfs-Brock writes:

There can be no doubt that the most widely deployed JSON parsers are
those that are built intp the browser _javascript_ implementations.
The ECMAScript 5 specification for JSON.parse that they implement
says BOM is an illegal character.  But what do the browser actually
implement?  This:

No, try e.g. jsonviewer.stack.hu [1] (works in Chrome, Safari, Opera,
not in IE or Firefox)

In Firefox, I got some garbled characters, in particular some question marks for each of the two bytes of the BOM and one question mark for the e-acute. Because of the type of the errors, I strongly suspect it is related to what we are trying to investigate, and so I don't think this can be taken as evidence one way or another.

or feed [2] to www.jsoneditoronline.org (Use
Open/Url) (works in Chrome, IE, Firefox, ran out of time to test more).

The fact that some libraries or Web sites accept a BOM for JSON isn't a proof that all (well, let's say the majority) accept a BOM.

Just to be clear about this.  My tests directly tested _javascript_ built-in JSON parsers WRT to BOM support in three major browsers.  The tests directly invoked the built-in JSON.parse functions and directly passed to them a source strings that was explicitly constructed to contain a BOM code point .  This was done to ensure that the all transport layers  (and any transcodings they might perform) were bypassed and that we were actually testing the real built-in JSON parse functions.

Neither of the sites referenced about perform a comparable test.  They take user inputed text when is then pass through whose knows what layers of browser and application preprocessing and then they present something derived from that original user input to a JSON parser.  In both bases the actual parser does not appear to be the the built-in _javascript_ JSON.parse function that I was testing.

json.view.stack.hu uses Ext.util.JSON.decode whose document describe it as "Modified version of Douglas Crockford"s json.js".   In other words not the built-in JSON.parse function

www.jsoneditoronlineorg uses a library called JSONLint in preference to the built-in JSON.parse function.  It does not conform to the ECMAScript 5 JSON.parse specification.

So testing using either of these sites say nothing relevant to about my observation concern BOM handling by the most widely deployed JSON parsers (the ones that are built into browser _javascript_ implementations) 

Allen
 

[Index of Archives]     [IETF Annoucements]     [IETF]     [IP Storage]     [Yosemite News]     [Linux SCTP]     [Linux Newbies]     [Fedora Users]