18

suppose I have the string

test
'\\u0259'

Note the escaped backslash.

How do I convert it to the respective unicode string?

Karl Knechtel
  • 62,466
  • 11
  • 102
  • 153
pogon
  • 305
  • 2
  • 3
  • 10

1 Answers1

39
>>> print('test \\u0259'.decode('unicode-escape'))
test ə
kennytm
  • 510,854
  • 105
  • 1,084
  • 1,005