0

I have lots of unicode characters codes stored as strings in Python3, e.g.

unicode = '3077'

where U+3077 is ぷ. How do I print this as human-readable text? I.e. how do I convert the string unicode to unicode_as_text such that:

>>> print(unicode_as_text)
ぷ
Rob S
  • 37
  • 5

1 Answers1

2

Your string is the unicode codepoint represented in hexdecimal, so the character can be rendered by printing the result of calling chr on the decimal value of the code point.

>>> print(chr(int('3077', 16)))
ぷ
snakecharmerb
  • 47,570
  • 11
  • 100
  • 153