[PATCH 0 of 1 stable] Re: [PATCH stable] templatefilters: make json filter handle multibyte characters correctly

Dirkjan Ochtman dirkjan at ochtman.nl
Tue Aug 10 02:30:32 CDT 2010


On Mon, Aug 9, 2010 at 19:50, Patrick Mézard <pmezard at gmail.com> wrote:
>> Thank you, but it shouldn't change the output encoding.
>> JSON-encoded data are passed to web browser with hgweb's HTML output,
>> which is in locale encoding.
>
> Isn't JSON documents encoding supposed to be a Unicode one?
>
>    http://www.ietf.org/rfc/rfc4627.txt
>
> """
> 3.  Encoding
>
>   JSON text SHALL be encoded in Unicode.  The default encoding is
>   UTF-8.
> """

Right, but I think that only holds if the JSON in question is
transmitted on its own. For our use case, we're transmitting it as JS
literals rather than JSON-by-itself, so I think different rules apply
(and it would seem to make sense if the page encoding is used for
this).

Cheers,

Dirkjan


More information about the Mercurial-devel mailing list