Python3中编码问题

html = r'{"code":404,"msg":"u8be5u8d44u6e90u4e0du5b58u5728"}'

print(html)
# {"code":404,"msg":"u8be5u8d44u6e90u4e0du5b58u5728"}

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

原文地址:https://www.cnblogs.com/math98/p/8782815.html