[Zope] unicodedecoderror in page templates

Andreas Jung lists at zopyx.com
Sun May 20 08:55:22 EDT 2007



--On 20. Mai 2007 14:50:12 +0200 Einar Næss Jensen 
<einar.nass.jensen at gmail.com> wrote:

> On 5/20/07, Andreas Jung <lists at zopyx.com> wrote:
>>
>>
>> --On 20. Mai 2007 14:20:38 +0200 Einar Næss Jensen
>> <einar.nass.jensen at gmail.com> wrote:
>>
>> > When I get errors like:
>> > UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position
>> > 2940: ordinal not in range(128)
>> > how can I locate the character which causes the error?
>> > In particular: where is the position (2940 in the example)?
>> >
>>
>> First you must provide the *full* traceback.
>
> sorry....:
>
> Request URL   http://localhost:10080/ordredfolder/einar.jensen/testview
>    Exception Type   UnicodeDecodeError
>    Exception Value   'ascii' codec can't decode byte 0xc3 in position
> 2940: ordinal not in range(128)
>
> Traceback (innermost last):
>   Module ZPublisher.Publish, line 114, in publish
>   Module ZPublisher.mapply, line 88, in mapply
>   Module ZPublisher.Publish, line 40, in call_object
>   Module Shared.DC.Scripts.Bindings, line 311, in __call__
>   Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
>   Module Products.PageTemplates.PageTemplateFile, line 110, in _exec
>   Module Products.PageTemplates.PageTemplate, line 105, in pt_render
>  <PageTemplateFile at /ordredfolder/einar.jensen/testview>
>   Module StringIO, line 271, in getvalueUnicodeDecodeError: 'ascii'
> codec can't decode byte 0xc3 in position 2940: ordinal not in
> range(128)
>

As Peter wrote: you are likely mixing somewhere different encodings with
unicode or something similar. Which Zope version are you using?
If 2.10 then you might check at the UnicodeConflictResolver as introduced
in Zope 2.10 (check the release notes). Otherwise ensure that you are not 
mixing unicode strings with non-unicode strings.

-aj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20070520/752490e3/attachment.bin


More information about the Zope mailing list