1

In Python3, how do I convert '\\u00A9 PNG' to '\u00A9 PNG' (or '© PNG')?

For Java, there is Apache Commons Lang to decode it.

I don't know how to do in Python3.

Community
  • 1
  • 1
Tody.Lu
  • 915
  • 9
  • 24

1 Answers1

2

This should work for you.

string = '\\u00A9 PNG'
print (string.encode('utf8').decode('unicode-escape'))

output:

© PNG

Seek Addo
  • 1,871
  • 2
  • 18
  • 30