Re: Unicode escapes with any backend encoding

Robert Haas <robertmhaas@gmail.com>

From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>, Chapman Flack <chap@anastigmatix.net>, PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2020-02-25T03:43:15Z
Lists: pgsql-hackers
On Mon, Feb 24, 2020 at 11:19 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I see this patch got sideswiped by the recent refactoring of JSON
> lexing.  Here's an attempt at fixing it up.  Since the frontend
> code isn't going to have access to encoding conversion facilities,
> this creates a difference between frontend and backend handling
> of JSON Unicode escapes, which is mildly annoying but probably
> isn't going to bother anyone in the real world.  Outside of
> jsonapi.c, there are no changes from v2.

For the record, as far as JSON goes, I think I'm responsible for the
current set of restrictions, and I'm not attached to them. I believe I
was uncertain of my ability to implement anything better than what we
have now and also slightly unclear on what the semantics ought to be.
I'm happy to see it improved, though.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



Commits

  1. Allow Unicode escapes in any server encoding, not only UTF-8.