Issue #2160 has been updated by Kornelius Kalnbach.


UTF byte order can be determined for valid JSON automatically. As Crockford states in his RFC:

   Since the first two characters of a JSON text will always be ASCII
   characters [RFC0020], it is possible to determine whether an octet
   stream is UTF-8, UTF-16 (BE or LE), or UTF-32 (BE or LE) by looking
   at the pattern of nulls in the first four octets.

I believe this is one of the reasons.

More reasons:

* In JavaScript, Arrays ([]) are really just Objects ({}). The term "JavaScript Object Notation" may be interpreted this way.
* People are forced to make their JSON content more readable by using { "width": 500 } instead of 500.
* JSONPath would look strange on such objects.

I'd rather allow comments, to use them in config files. We could have a JSON.parse(:strict => false) for this...
----------------------------------------
http://redmine.ruby-lang.org/issues/show/2160

----------------------------------------
http://redmine.ruby-lang.org