[CPS-devel] Re: UnicodeDecodeError indexing translated title of document.

Julien Anguenot ja at nuxeo.com
Fri Jun 2 14:33:05 CEST 2006


Yves Bastide wrote:
> JoseLuis de la Rosa Triviño wrote:
> [...]
>> UnicodeDecodeError: 'ascii' codec can't decode byte 0xed in position
>> 10: ordinal not in range(128)
>>> /opt/zope2.9/lib/python/Products/PluginIndexes/common/UnIndex.py(207)insertForwardIndexEntry()
>>>
>> -> indexRow = self._index.get(entry, _marker)
>> (Pdb) entry
>> u'Carlos Gonzalez created aaaaaaaaaaaaaa'
> 
> Your title is an Unicode string; you could try converting it to a string
> in your string:
> 
>   title = mcat('title_' + btool.ptool.CONTENTS_ID)
> + title = title.encode('iso8859-15')
>   docDef = {TITLE:title, DESCRIPT:'', HIDDE:0}
> 
> 
> (perhaps testing first that title is really unicode)

yup but it seems that translation_service is now returning unicode
strings. (I didn't follow the changes recently)

You may want to check this document to deal with your unicode conversion :

http://www.reportlab.com/i18n/python_unicode_tutorial.html

Zope2 is a real pain when it comes to unicode...

Keep us posted please.

	J.

-- 
Julien Anguenot | Nuxeo R&D (Paris, France)
Open Source ECM - www.nuxeo.com
CPS Platform - http://www.cps-project.org
Mobile: +33 (0) 6 72 57 57 66

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://lists.nuxeo.com/pipermail/cps-devel/attachments/20060602/1481eeb7/signature.pgp


More information about the cps-devel mailing list

This list archive provided by Nuxeo, the leaders of open source ECM. Check out the Nuxeo 5 open source, standards-based ECM project.