W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2012

Re: [XHR] responseType "json"

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 6 Jan 2012 13:45:51 -0800
Message-ID: <CAAWBYDCXrKGMbP9UcHcTqeTFkL8S9jLb69gAM-7D9gKnufyJWg@mail.gmail.com>
To: Ojan Vafai <ojan@chromium.org>
Cc: Boris Zbarsky <bzbarsky@mit.edu>, public-webapps@w3.org
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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:49 GMT