技术栈

excel打开csv文件乱码的问题

CriticalThinking2024-11-19 23:21

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

解决方法:

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

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

python 复制代码
open('xx.csv', encoding='utf-8-sig')
上一篇:训练误差or测试误差与特征个数之间的关系--基于R语言实现
下一篇:基于Raspberry Pi的智能温控系统设计
相关推荐
UR的出不克
16 小时前
使用 Python 爬取 Bilibili 弹幕数据并导出 Excel
java·python·excel
wtsolutions
17 小时前
Understanding Excel Data Formats - What Excel to JSON Supports
ui·json·excel
ぁず
17 小时前
excel想生成一列随机数并删除公式保留值
excel
wtsolutions
20 小时前
Real-World Use Cases - How Organizations Use Excel to JSON
json·github·excel
一只小H呀の
20 小时前
pandas处理excel数据
excel·pandas
wregjru
20 小时前
【操作系统】3.开发工具
excel
wtsolutions
1 天前
MCP Service Integration - Excel to JSON for AI and Automation
人工智能·json·excel
wtsolutions
1 天前
JSON to Excel Add-in - Seamless Integration Within Excel
json·excel
wtsolutions
1 天前
Getting Started with JSON to Excel Web App - Convert in Seconds
json·excel·web app
wtsolutions
2 天前
Using the JSON to Excel API - Programmatic Access for Developers
json·excel
热门推荐
01GitHub 镜像站点022025 Telegram 最新免费社工库机器人(LetsTG可[特殊字符])搭建指南(含 Python 脚本)03OpenCode 入门教程:介绍 · 安装 · 配置第三方 API (如 Claude)04Linux下V2Ray安装配置指南05UV安装并设置国内源06安娜的档案(Anna’s Archive) 镜像网站/国内最新可访问入口(持续更新)07AI 规范驱动开发“三剑客”深度对比:Spec-Kit、Kiro 与 OpenSpec 实战指南08Labelme从安装到标注:零基础完整指南09BongoCat - 跨平台键盘猫动画工具10Claude Code Skills 实用使用手册