Re: broken locale in 7.0.2 without multibyte support (FreeBSD 4.1-RELEASE) ? - Mailing list pgsql-hackers

From Tatsuo Ishii
Subject Re: broken locale in 7.0.2 without multibyte support (FreeBSD 4.1-RELEASE) ?
Date
Msg-id 20000918100057C.t-ishii@sra.co.jp
Whole thread Raw
In response to Re: broken locale in 7.0.2 without multibyte support (FreeBSD 4.1-RELEASE) ?  (Oleg Bartunov <oleg@sai.msu.su>)
List pgsql-hackers
> backend/regex/regcomp.c cause the problem. I compiled only this file
> with -funsigned-char option and the problem gone away !
> Also, I know that in case of --enable-multibyte I dont' have any problem,
> so in principle it's enough to look into 
> #ifdef MULTIBYTE sections in backend/regex/regcomp.c
> and made according
> #ifdef USE_LOCALE  sections
> 
> Tatsuo, am I right and what critical sections in backend/regex/regcomp.c ?

Besides the toupper etc. vs. signed char issues, there is an upper
limit of char values defined in include/regex/regex2.h. For none MB
installtions, it is defined as:

#define OUT          (CHAR_MAX+1)    /* a non-character value */

where CHAR_MAX gives 255 for "char = unsigned char" platforms. This is
good. However it gives 127 for "char = signed char" platforms. So if
you have some none ascii letters greater than 128 on "char = unsigned
char" platforms, you will lose.

Changing above to:

#define OUT          (UCHAR_MAX+1)    /* a non-character value */

might help...
--
Tatsuo Ishii


pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Notice and share memory corruption
Next
From: Philip Warner
Date:
Subject: Re: pg_dump tries to do too much per query