16

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?

Community
  • 1
  • 1
pogon
  • 285
  • 2
  • 3
  • 10

1 Answers1

37
>>> print('test \\u0259'.decode('unicode-escape'))
test ə
kennytm
  • 491,404
  • 99
  • 1,053
  • 989