Roger Ineichen wrote:
Exception Type
UnicodeDecodeError
Exception Value
'ascii' codec can't decode byte 0xc3 in position 891: ordinal not in
range(128)
...
body = ('%s\n<base href="%s" />\n%s' %
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 891:
ordinal not in range(128)
I got plenty of these recently, but it was all my fault. I was trying to
output some unicode strings with non-english characters and it took me
some time until I got it right.
If you have strings in .py files, which contain non-english characters,
try the following:
- save your .py files as utf8
- put a comment on the first, or second line of the file:
# coding: utf8
this takes care of python's warning
- decode all offending strings:
'some string'.decode('utf8')
Regards,
Velko Ivanov
_______________________________________________
Zope3-dev mailing list
[email protected]
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com