# unicode编码字符串转码utf8 aaa = "\xxx\xxx\xxx\xxx" print(aaa.encode(‘utf-8‘).decode(‘unicode_escape‘))
# 字典类型的unicode编码类型,转utf8 # 1、可以用json.loads() # 2、 from ast import literal_eval res = literal_eval(str(字典).replace(‘u\‘‘, ‘\‘‘).decode("unicode-escape")) print(res)
原文:https://www.cnblogs.com/lutt/p/13579844.html