Re: lower and upper not UTF-8 safe - Mailing list pgsql-hackers

From Tom Lane
Subject Re: lower and upper not UTF-8 safe
Date
Msg-id 21850.1060091150@sss.pgh.pa.us
Whole thread Raw
In response to Re: lower and upper not UTF-8 safe  (Karel Zak <zakkr@zf.jcu.cz>)
List pgsql-hackers
Karel Zak <zakkr@zf.jcu.cz> writes:
> On Mon, Aug 04, 2003 at 05:03:02PM -0400, Tom Lane wrote:
>> Only if you use a locale that is assuming a character set that is not
>> UTF8 but does have characters with the high bit set.  I'm not sure that
>> we can do anything to defend against locale/charset mismatch.

>  We can try detect typical locale charset and compare it with actual
>  charset used in DB and send NOTICE to FE if it's mismatched. The problem 
>  is portability of charset detection code, because there is differences 
>  between OS.

Yeah.  If we had a portable, reliable way of testing for incompatibility,
I'd be in favor of just forbidding creation of databases that have
encoding choices incompatible with the server's LC_COLLATE/LC_CTYPE
settings.  (If we ever allow those settings to be more dynamic than they
are, then the test would have to be made somewhere else, but for now it'd
be sufficient to put it in CREATE DATABASE.)

But I don't see a portable way to find out what charset a locale
supports.  nl_langinfo() isn't in the C standard at all.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Lamar Owen
Date:
Subject: Re: 7.4 beta binaries
Next
From: "Shridhar Daithankar"
Date:
Subject: Re: 7.4 beta binaries