Re: Bug #676: lower(), upper(), & initcap() do not work on - Mailing list pgsql-bugs

From Tatsuo Ishii
Subject Re: Bug #676: lower(), upper(), & initcap() do not work on
Date
Msg-id 20020528.100759.52176594.t-ishii@sra.co.jp
Whole thread Raw
In response to Re: Bug #676: lower(), upper(), & initcap() do not work on utf-8 chars  (Henry House <hajhouse@houseag.com>)
List pgsql-bugs
> > lower/upper-casing is driven by locale, not encoding.
> >
> > Unfortunately you didn't mention anything about your locale setup...
>
> The server locale is en_US.UTF-8. (At least I set it up as such when
> installing PostgreSQL; I know no way to verify.) The server version is 7.2.1,
> running on a IA32 and a DEC Alpha; both machines show the same behavior. Both
> are Debian Linux. Perhaps the bug lies in the locale definition supplied by
> Debian?

I don't think current locale support code works with mutibyte
encodings such as UTF-8. See the thread tiled "Bug #659:
lower()/upper() bug on" on pgsql-bugs and pgsql-hackers.

In the mean time, a work around would be something like:

select convert(lower(convert('X', 'LATIN1')),'LATIN1','UNICODE');

That will convert UTF-8 'X' to its lower case if you are sure that 'X'
could be converted to ISO-8859-1.

Of course the problem with this method is:

Someone has suggested me a fix using UTF-8 locales, but I'm worried
about usage of UTF-8 and am waiting for the test result with my
Japanese data.
--
Tatsuo Ishii

pgsql-bugs by date:

Previous
From: Chris Traylor
Date:
Subject: PgLargeObject bug
Next
From: Neil Conway
Date:
Subject: Re: views are not auto completed on psql