How to decode unicode raw literals to readable string? How to decode unicode raw literals to readable string? python python

How to decode unicode raw literals to readable string?


If you are getting weird results when decoding try following

print repr(s).decode('unicode-escape').encode('latin-1') // or encode using some other encoding

It could be that python terminal is using default ASCII and there is symbol that goes out of range.