Help: python unicode

tom z maillist.tom at gmail.com
Thu Feb 17 22:40:06 EST 2011


Hi all~
My script can't work.I've changed my defaultencoding from 'ascii' to
'utf-8',but Python also raises a 'UnicodeEncodeError' error.

the error likes this:

>>> s=u'La Pe\xf1a'
>>>print s
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf1' in position
5: ...

And in my script, there're many 'print' statements.So SOS~~~~
what should i do???
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110218/fa195396/attachment.html>


More information about the Python-list mailing list