Re: UTF-8 - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: UTF-8
Date
Msg-id 20061013165827.GN1896@svana.org
Whole thread Raw
In response to Re: UTF-8  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: UTF-8  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Fri, Oct 13, 2006 at 12:04:02PM -0400, Tom Lane wrote:
> "Tomi NA" <hefest@gmail.com> writes:
> > 2006/10/13, Martijn van Oosterhout <kleptog@svana.org>:
> >> Similarly, upper/lower are also supported, although postgresql doesn't
> >> take advantage of the system support in that case.
>
> > I think this is the crux of the problem.
>
> If it were true, then it might be ...

Eh? Here's the declaration of pg_toupper:

unsigned char pg_toupper(unsigned char ch);

Characters havn't fitted in an unsigned char in a very long time. It's
obviously bogus for any multibyte encoding (the code even says so). For
such encodings you could use the system's towupper() (ANSI C/Unix98)
which will work on any unicode char.

To make this work, pg_strupper() will have to convert each character to
Unicode, run towupper() and convert back to the encoding. I imagine
that'll get rejected for being inefficient, but really don't see any
other way.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

pgsql-general by date:

Previous
From: brian
Date:
Subject: Re: some log statements ignored
Next
From: Martijn van Oosterhout
Date:
Subject: Re: more anti-postgresql FUD