Re: invalidly encoded strings - Mailing list pgsql-hackers

From Albe Laurenz
Subject Re: invalidly encoded strings
Date
Msg-id D960CB61B694CF459DCFB4B0128514C22FBDA1@exadv11.host.magwien.gv.at
Whole thread Raw
In response to invalidly encoded strings  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
Andrew Dunstan wrote:
>> Instead of the code point, I'd prefer the actual encoding of
>> the character as argument to chr() and return value of ascii().
>
> And frankly, I don't know how to do it sanely anyway. A character
> encoding has a fixed byte pattern, but a given byte pattern
> doesn't have
> a single universal number value. I really don't think we want to have
> the value of chr(n) depend on the endianness of the machine, do we?
>
> The reason we are prepared to make an exception for Unicode
> is precisely because the code point maps to an encoding
> pattern independently of architecture, ISTM.

Point taken.

I only wanted to make sure that there are good reasons to
differ from Oracle.

Oracle's chr() is big-endian on all platforms, BTW.

Yours,
Laurenz Albe


pgsql-hackers by date:

Previous
From: Oleg Bartunov
Date:
Subject: Re: Ts_rank internals
Next
From: Zdenek Kotala
Date:
Subject: Re: Per-function search_path => per-function GUC settings