Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-adminpgsql-hackerspgsql-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

In response to

Responses

pgsql-hackers by date

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

pgsql-admin by date

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

pgsql-patches by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group