Re: Bug in UTF8-Validation Code? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Bug in UTF8-Validation Code?
Date
Msg-id 29864.1175553431@sss.pgh.pa.us
Whole thread Raw
In response to Re: Bug in UTF8-Validation Code?  (Mark Dilger <pgsql@markdilger.com>)
Responses Re: Bug in UTF8-Validation Code?  (Mark Dilger <pgsql@markdilger.com>)
List pgsql-hackers
Mark Dilger <pgsql@markdilger.com> writes:
>> pgsql=# select chr(14989485);
>> chr
>> -----
>> 中
>> (1 row)

Is there a principled rationale for this particular behavior as
opposed to any other?

In particular, in UTF8 land I'd have expected the argument of chr()
to be interpreted as a Unicode code point, not as actual UTF8 bytes
with a randomly-chosen endianness.

Not sure what to do in other multibyte encodings.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [PATCHES] pg_standby
Next
From: Bruce Momjian
Date:
Subject: Re: timestamp subtraction (was Re: [SQL] formatting intervals with to_char)