I have a list of utf-8 encoded objects such as : and decode it as follows: I notice that some emojis are not converted as expected as shown below: However, when I decode an individual string, I get the expected output: I’m not sure why the first approach using json.loads gives an unexpected output. Can someone provide any pointers? Answer
Tag: unicode-escapes
How to escape unicode special chars in string and write it to UTF encoded file
What I aim to achieve is to: string like: convert to: and write it in this form to file (which is UTF-8 encoded). Answer Another solution, not relying on the built-in repr() but rather implementing it from scratch: Differences: Encodes only using u, never any other sequence, whereas repr() uses about a third of the alphabet (so for example the