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

From Oleg Bartunov
Subject broken locale in 7.0.2 without multibyte support (FreeBSD 4.1-RELEASE) ?
Date
Msg-id Pine.GSO.3.96.SK.1000916132849.26064W-100000@ra
Whole thread Raw
Responses Re: broken locale in 7.0.2 without multibyte support (FreeBSD 4.1-RELEASE) ?
List pgsql-hackers
Hi,

while I'm doing more accurate test I just want to ask if
somebody test locale in 7.0.2 under FreeBSD ?
the point is that I usually compile postgres with 
--enable-locale --enable-multibyte and never had a problem 
with locale. Today I decided to use only --enable-locale
and found that LC_CTYPE support seems broken in 7.0.2 
under FreeBSD 4.01. release. 
I used folowing select: select c_name from city where c_name ~* 'ал';
interesting that there are no problem  under Linux !
I used the same compiler gcc version 2.95.2 19991024 (release)
on both systems. One hypothesis is that gcc 2.95.2 under Linux
treats 'char' as 'unsigned char' while on FreeBSD there is no such 
default. This could be demonstrated using test-ctype.c from
src/test/locale directory. In current version there is

.......
void
describe_char(int c)
{       char            cp = c,                               up = toupper(c),                               lo =
tolower(c);
...........

which works as expected on Linux and broken under FreeBSD (gcc 2.95.2)
It's clear that we must use 'unsigned char' instead of 'char'
and corrected version runs ok on both systems. That's why I suspect
that gcc 2.95.2 has different default under FreeBSD which could
cause problem with LC_CTYPE in 7.0.2 
I didn't test current CVS under FreeBSD but probably will check it.

Regards,
    Oleg
PS.
forget to mention that collation works fine 

_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83



pgsql-hackers by date:

Previous
From: Fabrice Scemama
Date:
Subject: Re: Winner Notification - Linux Magazine Editor's Choice Awards(fwd))
Next
From: "Maurizio"
Date:
Subject: SIGSEGV in postgres 7.0.0 for QNX