Python3中編碼問題

html = r'{"code":404,"msg":"\u8be5\u8d44\u6e90\u4e0d\u5b58\u5728"}'html

print(html)
# {"code":404,"msg":"\u8be5\u8d44\u6e90\u4e0d\u5b58\u5728"}code

print(html.encode('utf-8').decode('unicode-escape'))
# {"code":404,"msg":"該資源不存在"}htm

相關文章
相關標籤/搜索