Python字符乱码

content = b'{"log_id": 5507183146687669657, "words_result_num": 2, "words_result": [{"location": {"width": 154, "top": 102, "left": 216, "height": 53}, "words": "xe5x8fxa5xe7x9cx9fxe8xa9xb1"}, {"location": {"width": 198, "top": 148, "left": 168, "height": 20}, "words": "xe8x83xbdxe6xafx94xe6x95xb4xe5x80x8bxe4xb8x96xe7x95x8cxe7x9ax84xe5x88x86xe9x87x8fxe9x82x84xe9x87x8d"}]}'

解决方法:

content = content.decode('UTF-8')

或者

content = bytes.decode(content)

原文地址:https://www.cnblogs.com/chenlove/p/8997284.html