Python解决unicode编码,如\xe9\x9d\x92\xe8\x9b\x99\xe7\x8e\x8b\xe5\xad\x90转中文

时间:2021-05-03 20:15:04

Unicode到中文:
http://blog.csdn.net/baidu_19473529/article/details/54949453

s = '\xe9\x9d\x92\xe8\x9b\x99\xe7\x8e\x8b\xe5\xad\x90'
ss = s.encode('raw_unicode_escape')
print(ss)  # 结果:b'\xe9\x9d\x92\xe8\x9b\x99\xe7\x8e\x8b\xe5\xad\x90'
sss = ss.decode()
print(sss)