W3C home > Mailing lists > Public > www-tag@w3.org > November 2013

Re: [Json] BOMs

From: John Cowan <cowan@mercury.ccil.org>
Date: Thu, 21 Nov 2013 14:15:33 -0500
To: Bjoern Hoehrmann <derhoermi@gmx.net>
Cc: Allen Wirfs-Brock <allen@wirfs-brock.com>, Henri Sivonen <hsivonen@hsivonen.fi>, es-discuss <es-discuss@mozilla.org>, IETF Discussion <ietf@ietf.org>, www-tag <www-tag@w3.org>, JSON WG <json@ietf.org>
Message-ID: <20131121191533.GC12138@mercury.ccil.org>
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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:57:00 UTC