How to decode Unicode escape sequence emojis encoded as uXXXX?
Question:
I am trying to use python to sort through my downloaded Instagram data, the data is a json file, but emoji and other non-text characters are encoded in a way I do not understand, for example:
The json file will contain:
u00e2u009cu008cu00f0u009fu0096u00a4u00f0u009fu008du0095u00f0u009fu008eu00b6u00f0u009fu00a4u00af
.
Which on the instagram app is displayed:
✌
Or json: u00e2u0080u0099
. Instagram: '
(apostrophe)
I have tried to use u"string"
and have found similar questions here, here and here but none are in python or provide any useful details to me.
Answers:
Try
.encode('latin-1').decode('utf-8')))
if you are on windows press win + .
you will get a prompt with emojis
then do
print(" ")
output:
I am trying to use python to sort through my downloaded Instagram data, the data is a json file, but emoji and other non-text characters are encoded in a way I do not understand, for example:
The json file will contain:
u00e2u009cu008cu00f0u009fu0096u00a4u00f0u009fu008du0095u00f0u009fu008eu00b6u00f0u009fu00a4u00af
.
Which on the instagram app is displayed:
✌
Or json: u00e2u0080u0099
. Instagram: '
(apostrophe)
I have tried to use u"string"
and have found similar questions here, here and here but none are in python or provide any useful details to me.
Try
.encode('latin-1').decode('utf-8')))
if you are on windows press win + .
you will get a prompt with emojis
then do
print(" ")
output: