如何解码编码为 \uXXXX 的 Unicode 转义序列表情符号?

Ele*_*ant 3 python json emoji instagram python-unicode

我正在尝试使用 python 对我下载的 Instagram 数据进行排序,数据是一个 json 文件,但表情符号和其他非文本字符的编码方式我不明白,例如:

json 文件将包含: \u00e2\u009c\u008c\u00f0\u009f\u0096\u00a4\u00f0\u009f\u008d\u0095\u00f0\u009f\u008e\u00b6\u00f0\u009f\u00a4\u00af. 在 Instagram 应用程序上显示的是: ?

或 json: \u00e2\u0080\u0099. Instagram:('撇号)

我尝试使用u"string"在此处此处此处找到了类似的问题,但没有一个是在 python 中的,也没有向我提供任何有用的详细信息。

Ani*_*Ani 6

尝试

print(('\u00e2\u009c\u008c\u00f0\u009f\u0096\u00a4\u00f0\u009f\u008d\u0095\u00f0\u009f\u008e\u00b6\u00f0\u009f\u00a4\u00af'.encode('latin-1').decode('utf-8')))
Run Code Online (Sandbox Code Playgroud)

输出:

?
Run Code Online (Sandbox Code Playgroud)