text with unicode escape sequences to unicode in python

Question:

suppose I have the string

test
'\u0259'

Note the escaped backslash.

How do I convert it to the respective unicode string?

Asked By: pogon

||

Answers:

>>> print('test \u0259'.decode('unicode-escape'))
test ə
Answered By: kennytm
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.