PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, October 26, 2022

[FIXED] How to decode Unicode escape sequence emojis encoded as \uXXXX?

 October 26, 2022     emoji, instagram, json, python, python-unicode     No comments   

Issue

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: \u00e2\u009c\u008c\u00f0\u009f\u0096\u00a4\u00f0\u009f\u008d\u0095\u00f0\u009f\u008e\u00b6\u00f0\u009f\u00a4\u00af. Which on the instagram app is displayed: ✌πŸ–€πŸ•πŸŽΆπŸ€―

Or json: \u00e2\u0080\u0099. 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.


Solution

Try

.encode('latin-1').decode('utf-8')))


Answered By - Ani
Answer Checked By - Cary Denson (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing