Re: [XHR] responseType "json"

On Fri, Jan 6, 2012 at 12:36 PM, Ojan Vafai <ojan@chromium.org> wrote:
> I'm ambivalent about whether we should restrict to utf8 or not. On the one
> hand, having everyone on utf8 would greatly simplify the web. On the other
> hand, I can imagine this hurting download size for japanese/chinese websites
> (i.e. they'd want utf-16).

Note that this may be subject to the same counter-intuitive forces
that cause UTF-8 to usually be better for CJK HTML pages (because a
lot of the source is ASCII markup).  In JSON, all of the markup
artifacts (braces, brackets, quotes, colon, commas, spaces) are ASCII,
along with numbers, bools, and null.  Only the contents of strings can
be non-ascii.

JSON is generally lighter on markup than XML-like languages, so the
effect may not be as pronounced, but it shouldn't be dismissed without
some study.  At minimum, it will *reduce* the size difference between
the two.

~TJ

Received on Saturday, 7 January 2012 04:58:00 UTC