Re: [HACKERS] [ADMIN] invalid multibyte character for locale

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bjoern Metzdorf <bm(at)turtle-entertainment(dot)de>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] [ADMIN] invalid multibyte character for locale
Date: 2005-03-15 05:26:16
Message-ID: 200503150526.j2F5QGw15413@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers pgsql-patches

Tom Lane wrote:
> Bjoern Metzdorf <bm(at)turtle-entertainment(dot)de> writes:
> > I assume I could just remove
> > #define USE_WIDE_UPPER_LOWER
> > from oracle_compat.c to emulate the old behaviour. But a cleaner fix
> > would be to check if we are using UNICODE and locale is C or POSIX and
> > only then skip USE_WIDE_UPPER_LOWER.
>
> Perhaps it would be reasonable to do something like this:
>
> #ifdef USE_WIDE_UPPER_LOWER
> /*
> * use wide char code only when max encoding length > one
> * and we aren't in C locale
> */
> if (pg_database_encoding_max_length() > 1 &&
> !lc_ctype_is_c())
> {
>
> where lc_ctype_is_c() is the obvious clone of the existing
> lc_collate_is_c() routine. We can reasonably assume that mbstowcs
> is going to be unable to offer any useful behavior in C locale.

Tom, is this the fix you were thinking of? Seems like it would be a
good improvement.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Attachment Content-Type Size
unknown_filename text/plain 3.5 KB

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2005-03-15 05:52:03 Re: [HACKERS] [ADMIN] invalid multibyte character for locale
Previous Message Gordon A. Fox 2005-03-14 23:43:20 Fixing "old version was found" error

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2005-03-15 05:31:17 Re: idea for concurrent seqscans
Previous Message Qingqing Zhou 2005-03-15 05:19:46 Re: invalidating cached plans

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2005-03-15 05:52:03 Re: [HACKERS] [ADMIN] invalid multibyte character for locale
Previous Message Christopher Kings-Lynne 2005-03-15 01:57:56 Improvement to charset docs