Re: [ADMIN] invalid multibyte character for locale

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bjoern Metzdorf <bm(at)turtle-entertainment(dot)de>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [ADMIN] invalid multibyte character for locale
Date: 2005-02-24 17:44:00
Message-ID: 25979.1109267040@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers pgsql-patches

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.

Comments?

regards, tom lane

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Alex Gutman 2005-02-24 18:22:09 Re: Preventing changes to default settings of a collective account?
Previous Message Scott Marlowe 2005-02-24 17:43:58 Re: Preventing changes to default settings of a collective

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2005-02-24 17:44:25 Re: [pgsql-hackers-win32] win32 performance - fsync question
Previous Message Marc G. Fournier 2005-02-24 17:28:16 Re: [HACKERS] Some download statistics

Browse pgsql-patches by date

  From Date Subject
Next Message Ron Mayer 2005-02-24 21:52:59 Re: [PATCHES] A way to let Vacuum warn if FSM settings are low.
Previous Message Bjoern Metzdorf 2005-02-24 17:22:51 Re: invalid multibyte character for locale