[Zope] ZCatalog patch for international characters
Holger Cornelsen
Holger.Cornelsen@t-online.de
Wed, 26 Jul 2000 20:48:17 +0100
Hi,
I had a lot of problems to get the ZCatalog search work for
international characters like german Umlauts (üäö etc.)
I have read all the tips about setting the locale and so on,
but nothing worked.
Now I found a solution:
I've added this line at the top of lib/python/SearchIndex/Splitter.c
#define __XPG4_CHAR_CLASS__
just before the include of ctype.h. Then I recompiled Splitter.c (simply
said make in the lib/python/SearchIndex directory) which recreates the
shared library Splitter.so
The define changes the behavior of utility functions like isalpha so
that they work for the current local set.
Before I restarted Zope I had set the current local with:
setenv LANG de_DE.ISO8859-1
setenv LC_COLLATE de_DE.ISO8859-1
setenv LC_CTYPE de_DE.ISO8859-1
setenv LC_MESSAGES de_DE.ISO8859-1
setenv LC_MONETARY de_DE.ISO8859-1
setenv LC_NUMERIC de_DE.ISO8859-1
setenv LC_TIME de_DE.ISO8859-1
setenv LC_ALL de_DE.ISO8859-1
Then I restarted Zope and reindexed the ZCatalog and now I can find
words with german Umlauts :-)
I'm working on a Sun Sparc with Solaris 8 using gcc.
Hope this tip helps
Holger