[Zope] Unicode Error ASCII -> decoding error: ordinal not in range(128)

Shashank Ashtikar shashank at hbcse.tifr.res.in
Thu Oct 2 04:08:09 EDT 2003


Hello friends,

I am trying to import unicode content in to ZODB using an external method.
This content is being added as a property.

The error that I am Getting is

Error Type: UnicodeError
Error Value: ASCII decoding error: ordinal not in range(128)

I did some googling and I found out that this is because of pythons
default encoding being ascii. But I did not come across any particular 
solution. The text that I am trying to import is Hindi language text 
(i.e. ISO - 10646 encoding.) 

The actual traceback of the error is,
Traceback (innermost last):
  Module ZPublisher.Publish, line 98, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 39, in call_object
  Module Products.ExternalMethod.ExternalMethod, line 224, in __call__
   - __traceback_info__: ((<TransparentFolder instance at 8cf1f68>, <HTTPRequest, URL=http://gnu.hbcse.tifr.res.in:9673/IndicTrans/indic2/Programs/import_po>), {}, (None,))
  Module /usr/lib/zope/lib/python/Products/GNOWSYS/Extensions/po_import.py, line 47, in manage_addPoFile
  Module OFS.PropertyManager, line 247, in manage_addProperty
  Module ZPublisher.Converters, line 123, in __call__
UnicodeError: ASCII decoding error: ordinal not in range(128)

The line 47 in the external method is

objRef.manage_addProperty('trString', msgText1, 'utext')

here "objRef" is the object handle which I got using restrictedTraverse API
"trString" is the property id and "msgText1" is the variable containing
actual unicode string.

Any help or pointers???

Thanks in Advance.

Shashank



More information about the Zope mailing list