既爱又恨的编码格式
Python相关
Encode和Decode
str.decode(encoding=“utf-8”, errors='strict') # 严格str.encode(encoding=“utf-8”, errors='ignore') #忽略错误
写入正常,结果打开乱码
data_df.to_csv(filename.csv, index=False, encoding='utf-8-sig')
写入报错,有些字符不能转换
最后更新于