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

From: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
To: pgsql-hackers(at)postgresql(dot)org
Cc: t-ishii(at)sra(dot)co(dot)jp
Subject: broken locale in 7.0.2 without multibyte support (FreeBSD 4.1-RELEASE) ?
Date: 2000-09-16 10:54:49
Message-ID: Pine.GSO.3.96.SK.1000916132849.26064W-100000@ra
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabrice Scemama 2000-09-16 12:16:42 Re: Winner Notification - Linux Magazine Editor's Choice Awards(fwd))
Previous Message Mario Weilguni 2000-09-16 08:51:05 Re: Patch for TNS services