将含有unicode编码的字符串转换成正确的形式 请求里面拿到的数据有个这样的内容 'so\\2192such' 其实\2192它是一个符号’→’对应的unicode编码 怎么才能把它转回原本的样子呢 answer = rightans.decode("unicode-escape") 然而报错了:'str' object has no attribute 'decode' 原来是因为python3的str类型默认就是unicode编码,所以没有办法再decode。需要先encode再decode answer = rightans.encode('utf-8')