Re: [Json] BOMs

Bjoern Hoehrmann scripsit:

> Is there any chance, by the way, to change `JSON.stringify` so it does
> not output strings that cannot be encoded using UTF-8? Specifically,
> 
>   JSON.stringify(JSON.parse("\"\uD800\""))
> 
> would need to escape the surrogate instead of emitting it literally.

No, there isn't.  We've been down this road repeatedly.  People can and
do use JSON strings to encode arbitrary sequences of unsigned 16-bit integers.

-- 
You let them out again, Old Man Willow!                 John Cowan
What you be a-thinking of?  You should not be waking!   cowan@ccil.org
Eat earth!  Dig deep!  Drink water!  Go to sleep!
Bombadil is talking.                                    http://ccil.org/~cowan

Received on Thursday, 21 November 2013 19:16:07 UTC