Python 3.1, trying to unescape html/unicode/xml characters

Posted by Sho Minamimoto on Stack Overflow See other posts from Stack Overflow or by Sho Minamimoto
Published on 2010-03-08T00:07:48Z Indexed on 2010/03/08 0:12 UTC
Read the original article Hit count: 741

Filed under:
|
|

I found my problem here, but there is only an answer for Python 2.6. Basically, I need to unescape strings such as this: 'a altieri_joão' to show the proper characters.

http://stackoverflow.com/questions/990169/how-do-convert-unicode-escape-sequences-to-unicode-characters-in-a-python-string

I need to do this in 3.1, but when I try

print (u'a altieri_joão')

if gives me invalid syntax. And when I try

name.decode('latin-1')

it says 'str' has no method 'decode'.

© Stack Overflow or respective owner

Related posts about python-3.x

Related posts about unicode