From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Unicode normalization test broken output
Date: Mon, 09 Dec 2019 17:22:39 -0500
Message-ID: <16791.1575930159@sss.pgh.pa.us> (raw)
In-Reply-To: <6a7a8516-7d11-8fbd-0e8b-eadb4f0679eb@2ndquadrant.com>
References: <6a7a8516-7d11-8fbd-0e8b-eadb4f0679eb@2ndquadrant.com>
Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
> There appear to be several off-by-more-than-one errors in norm_test.c
> print_wchar_str(). Attached is a patch to fix this (and make the output
> a bit prettier). Result afterwards:
I concur that this looks broken and your patch improves it.
But I'm not very happy about the remaining assumption that
we don't have to worry about characters above U+FFFF. I'd
rather see it allocate 11 bytes per allowed pg_wchar, and
manage the string contents with something like
p += sprintf(p, "U+%04X ", *s);
An alternative fix would be to start using a PQExpBuffer, but
it's probably not quite worth that.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, peter.eisentraut@2ndquadrant.com
Subject: Re: Unicode normalization test broken output
In-Reply-To: <16791.1575930159@sss.pgh.pa.us>
References: <6a7a8516-7d11-8fbd-0e8b-eadb4f0679eb@2ndquadrant.com> <16791.1575930159@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox