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

From: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
To: oleg(at)sai(dot)msu(dot)su
Cc: tgl(at)sss(dot)pgh(dot)pa(dot)us, peter_e(at)gmx(dot)net, pgsql-hackers(at)postgresql(dot)org
Subject: Re: broken locale in 7.0.2 without multibyte support (FreeBSD 4.1-RELEASE) ?
Date: 2000-09-18 01:00:57
Message-ID: 20000918100057C.t-ishii@sra.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Meskes 2000-09-18 01:59:57 Re: type OIDs
Previous Message Jonathan Stanford 2000-09-18 00:36:09 Odd behaviour - *possible* ODBC bug?