Re: Bug #676: lower(), upper(), & initcap() do not work on

From: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
To: hajhouse(at)houseag(dot)com
Cc: tgl(at)sss(dot)pgh(dot)pa(dot)us, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Bug #676: lower(), upper(), & initcap() do not work on
Date: 2002-05-28 01:07:59
Message-ID: 20020528.100759.52176594.t-ishii@sra.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Neil Conway 2002-05-28 02:21:31 Re: views are not auto completed on psql
Previous Message Chris Traylor 2002-05-27 18:59:11 PgLargeObject bug