Re: JSON and unicode surrogate pairs - Mailing list pgsql-hackers

From Tom Lane
Subject Re: JSON and unicode surrogate pairs
Date
Msg-id 23366.1370879008@sss.pgh.pa.us
Whole thread Raw
In response to Re: JSON and unicode surrogate pairs  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: JSON and unicode surrogate pairs
List pgsql-hackers
Andrew Dunstan <andrew@dunslane.net> writes:
> Or we could abandon the conversion altogether, but that doesn't seem 
> very friendly either. I suspect the biggest case for people to use these 
> sequences is where the database is UTF8 but the client encoding is not.

Well, if that's actually the biggest use-case, then maybe we should just
say we're *not* in the business of converting those escapes.  That would
make things nice and consistent regardless of the DB encoding, and it
would avoid the problem of being able to input a value and then not
being able to output it again.

It's legal, is it not, to just write the equivalent Unicode character in
the JSON string and not use the escapes?  If so I would think that that
would be the most common usage.  If someone's writing an escape, they
probably had a reason for doing it that way, and might not appreciate
our overriding their decision.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Will Crawford
Date:
Subject: Re: SPGist "triple parity" concept doesn't work
Next
From: Tom Lane
Date:
Subject: Re: SPGist "triple parity" concept doesn't work