Unix Technical Forum

Re: [ADMIN] invalid multibyte character for locale

This is a discussion on Re: [ADMIN] invalid multibyte character for locale within the pgsql Hackers forums, part of the PostgreSQL category; --> Bjoern Metzdorf <bm@turtle-entertainment.de> writes: > I assume I could just remove > #define USE_WIDE_UPPER_LOWER > from oracle_compat.c to emulate ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Hackers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-11-2008, 03:50 AM
Tom Lane
 
Posts: n/a
Default Re: [ADMIN] invalid multibyte character for locale

Bjoern Metzdorf <bm@turtle-entertainment.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

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:06 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com