Re: JSON for PG 9.2 - Mailing list pgsql-hackers

From Joey Adams
Subject Re: JSON for PG 9.2
Date
Msg-id CAARyMpC_rsMgR2=39ExLkN36d8sozA_7TQHK1bJSA5PCDDBeuQ@mail.gmail.com
Whole thread Raw
In response to Re: JSON for PG 9.2  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: JSON for PG 9.2  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On Fri, Dec 16, 2011 at 8:52 AM, Robert Haas <robertmhaas@gmail.com> wrote:
> But I think the important point is that this is an obscure corner case.  Let me say that one
more time: obscure corner case!

+1

> The only reason JSON needs to care about this at all is that it allows
> \u1234 to mean Unicode code point 0x1234.  But for that detail, JSON
> would be encoding-agnostic.  So I think it's sufficient for us to
> simply decide that that particular feature may not work (or even, will
> not work) for non-ASCII characters if you use a non-UTF8 encoding.
> There's still plenty of useful things that can be done with JSON even
> if that particular feature is not available; and that way we don't
> have to completely disable the data type just because someone wants to
> use EUC-JP or something.

So, if the server encoding is not UTF-8, should we ban Unicode escapes:
   "\u00FCber"

or non-ASCII characters?
   "über"

Also:
* What if the server encoding is SQL_ASCII?
* What if the server encoding is UTF-8, but the client encoding is
something else (e.g. SQL_ASCII)?

- Joey


pgsql-hackers by date:

Previous
From: Dimitri Fontaine
Date:
Subject: Re: Prep object creation hooks, and related sepgsql updates
Next
From: Peter Geoghegan
Date:
Subject: Re: CommitFest 2011-11 Update