html = r'{"code":404,"msg":"\u8be5\u8d44\u6e90\u4e0d\u5b58\u5728"}'
print(html)
# {"code":404,"msg":"\u8be5\u8d44\u6e90\u4e0d\u5b58\u5728"}print(html.encode('utf-8').decode('unicode-escape'))
# {"code":404,"msg":"该资源不存在"}
本文共 272 字,大约阅读时间需要 1 分钟。
html = r'{"code":404,"msg":"\u8be5\u8d44\u6e90\u4e0d\u5b58\u5728"}'
print(html)
# {"code":404,"msg":"\u8be5\u8d44\u6e90\u4e0d\u5b58\u5728"}print(html.encode('utf-8').decode('unicode-escape'))
# {"code":404,"msg":"该资源不存在"}
转载于:https://www.cnblogs.com/math98/p/8782815.html