Alex Rivera | Logout

text with unicode escape sequences to unicode in python

Asked 2010-10-23T14:22:05.257
19

suppose I have the string

test
'\\u0259'

Note the escaped backslash.

How do I convert it to the respective unicode string?

Edit
Report

1 Answer

41
>>> print('test \\u0259'.decode('unicode-escape'))
test ə
answered 2010-10-23T14:24:11.620

Your Answer