[Zope] Problem with TextIndexNG

Dieter Maurer dieter@handshake.de
Fri, 13 Jun 2003 21:30:04 +0200


Chris Withers wrote at 2003-6-12 14:54 +0100:
 > Dieter Maurer wrote:
 > > Thierry FLORAC wrote at 2003-6-11 15:54 +0200:
 > >  > ...
 > >  > When I enter a phrase query on this index (using double quotes) w=
ith some=20
 > >  > accentuated characters (like "d=E9partement"), I raise an excepti=
on :
 > >  >   UnicodeError: ASCII encoding error: ordinal not in range (128).
 > >  >=20
 > >  > The same query without quotes doesn't fail.
 > >=20
 > > I hate these "encoding error" and get rid of them by
 > > setting Python's default encoding in "sitecustomize.py"
 > > to our default encoding.
 >=20
 > I never got my head around how to use these...
 >=20
 > What do you change and what have you changed it to?

My sitecustomize.py looks like:


import sys
sys.setdefaultencoding('iso-8859-1')


Nowadays, "iso-8859-15" would be more correct (it contains the Euro sign).


Dieter