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

Re: [ADMIN] invalid multibyte character for locale

From
Tom Lane
Date:
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