tags:

views:

37

answers:

1

Possible Duplicate:
Conversion of strings like \\uXXXX in python

Hi, suppose I have the string

test
'\\u0259'

Note the escaped backslash.

How do I convert it to the respective unicode string?

+3  A: 
>>> print 'test \\u0259'.decode('unicode-escape')
test ə
KennyTM
+1. Note that if you run python 3.x, you'll need `print(bytes('test \\u0259', 'ascii').decode('unicode-escape'))` instead.
Frédéric Hamidi