[Zope] locale and Splitter.c on FreeBSD - where is the bug ?

Oleg Broytmann phd@mail2.phd.pp.ru
Sat, 9 Sep 2000 12:52:40 +0000 (GMT)


On Sat, 9 Sep 2000, Aleksander Salwa wrote:
> Some time ago I had a problem with locales on FreeBSD.
> Finally, I solved it by patching Splitter.c.
> 
> I added casting of values passed to funtions isalpha, isalnum to
> type 'unsigned char'. They are declared in Splitter.c as 'char'.
> 
> On all machines I'm working on, 'char' is signed.
> On Linux/x86, isalpha and others works fine with positive and negative
> values of national characters. (For example, one polish character is
> '\xc6', what can be evaluated as unsigned 198, or signed -58.)
> But on FreeBSD/x86 these functions work only with values >127.
> Because 'char' is signed, it needs casting to work with national
> characters.
> 
> Now, the question is: is it a bug in Splitter.c or in FreeBSD system
> libraries ? (or misconfigured system)

   It is bug in Linux libraries! They tricked you to think it is right way,
but it is actually wrong way. FreeBSD (in this aspect) is better, more
strict (there are aspect where Linux clearly wins :).
   Compile Zope with gcc -funsigned-char on FreeBSD.

Oleg.
---- 
     Oleg Broytmann            http://phd.pp.ru/            phd@phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.