I am writing in Python 3.12 and I have this text:
text = "randomstrings :n- ud83cudf10u26a1n- ud83dudcb0u2b07ufe0fn- ud83dudee0ufe0fud83dudd04"
Originally it was a string with emojis (that I could see correctly), then I saved it into a json.
Now when I loaded the json I found out I can’t read the emojis again.
I tried
text.encode('utf-8').decode('unicode-escape')
but it did not work
UnicodeEncodeError: ‘utf-8’ codec can’t encode characters
1