[Zope-dev] Another weird unicode error from Zope 2
Charlie Clark
charlie.clark at clark-consulting.eu
Tue Oct 12 11:00:51 EDT 2010
Am 12.10.2010, 16:51 Uhr, schrieb Chris Withers <chris at simplistix.co.uk>:
> UnicodeEncodeError: 'charmap' codec can't encode character u'\u203a' in
> position 2439: character maps to <undefined>
Hi Chris,
according to http://wiki.python.org/moin/UnicodeEncodeError this is what
you get when you try and encode a unicode codepoint to a charset which
cannot represent it. The error message appears to depend upon the charset:
>>> u'\u203a'.encode("iso-8859-15")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/encodings/iso8859_15.py",
line 12, in encode
return codecs.charmap_encode(input,errors,encoding_table)
UnicodeEncodeError: 'charmap' codec can't encode character u'\u203a' in
position 0: character maps to <undefined>
>>> u'\u203a'.encode("latin-1")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'latin-1' codec can't encode character u'\u203a' in
position 0: ordinal not in range(256)
ISO-8859-15 is, of course, Latin-1 + the €
Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
More information about the Zope-Dev
mailing list