excel打开csv文件乱码的问题

如图所示,在保存csv文件时已指定编码为utf-8,用excel打开后仍然乱码

解决方法:

在保存csv文件时指定编码为utf-8-sig

该编码方式会在文件开头加入一个 BOM(Byte Order Mark),有助于 Excel 正确识别 UTF-8 编码。

python 复制代码
open('xx.csv', encoding='utf-8-sig')
相关推荐
wtsolutions12 小时前
Understanding JSON Formats - What JSON to Excel Supports
json·excel
wtsolutions12 小时前
Advanced Features - Unlocking the Power of JSON to Excel Pro
linux·json·excel
fs哆哆14 小时前
VB.NET和VBA教程-如何查找Excel数据区域边界
excel
小矮强14 小时前
Excel中根据年月日提取月日,并按月日进行排序
excel
开开心心_Every14 小时前
图片批量压缩工具:支持有损无损两种模式
python·游戏·微信·django·pdf·excel·语音识别
wtsolutions15 小时前
Real-World Use Cases - How Organizations Use JSON to Excel
json·excel
wtsolutions15 小时前
Introduction to JSON to Excel - The Ultimate Conversion Tool
json·excel
骆驼爱记录16 小时前
Python打包命令全攻略
自动化·word·excel·新人首发
wtsolutions16 小时前
JSON to Excel WPS Add-in - Perfect for WPS Office Users
json·excel·wps
hhzz17 小时前
Springboot项目中使用EasyPOI操作Excel(详细教程系列4/4)
java·spring boot·后端·spring·excel·poi·easypoi