Re: Unicode escapes with any backend encoding

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Cc: Chapman Flack <chap@anastigmatix.net>, PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2020-02-24T17:49:03Z
Lists: pgsql-hackers

Attachments

I wrote:
> [ unicode-escapes-with-other-server-encodings-2.patch ]

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.

			regards, tom lane

Commits

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