Re: Another weird unicode error from Zope 2

"Charlie Clark" <[email protected]>
Newsgroups gmane.comp.web.zope.devel
Organization Clark Consulting & Research
Message-ID <[email protected]>
Am 12.10.2010, 16:51 Uhr, schrieb Chris Withers <[email protected]>:

> 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
_______________________________________________
Zope-Dev maillist  -  [email protected]
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.