3 ms·
> You would expect encode(decode(string)) == string With Unicode string handling I already wouldn't expect that, not to mention whitespace. However, I would ex
by inimino 10y ago
> You would expect encode(decode(string)) == string
With Unicode string handling I already wouldn't expect that, not to mention whitespace. However, I would expect that dec(enc(dec(string))) === dec(string)
> {"visitorCount": 42.0} is perfectly valid
The problem here is not necessarily that the standard is informal, but that languages differ in the number types they offer. Treating "42.0" as something different from "42" is after all just another convention and not a universal one. In other words, having to coerce something to an integer is more a property of the environment than a problem with JSON.