If you have encoded emojis in a string, and you can't print them, do this:
>>> data = "Those are emojis -> \ud83d\ude2e\ud83d\ude02\ud83d\ude02"
>>> data.encode('utf-16', 'surrogatepass').decode('utf-16')
'😮😂😂'
This should work with any character encoded as two 16-bit hex value.
Top comments (0)