We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用版本是 3.1.0 ,在导入CSV 的时候出现了首列无法导入的问题,后来发现是 UTF-8 BOM 编码导致的,已经解决了,解决思路是在获取文件流后先处理bom标识,然后再处理数据的导入。建议官方将此功能集成到框架中。 核心代码如下
public InputStream getInputStream(InputStream in) throws IOException { PushbackInputStream backStream = new PushbackInputStream(in); int ch = backStream.read(); if (ch != 0xEF) { backStream.unread(ch); } else if ((ch = backStream.read()) != 0xBB) { backStream.unread(ch); backStream.unread(0xef); } else if ((ch = backStream.read()) != 0xBF) { throw new IOException("错误的CSV文件"); } else { } return backStream; } data = EasyExcel.read(getInputStream(file.getInputStream())).excelType(ExcelTypeEnum.CSV).head(XXX.class).sheet().doReadSync();
The text was updated successfully, but these errors were encountered:
#3019 等待合并了
Sorry, something went wrong.
* 读csv会忽略BOM数据 [Issue #3137](#3137)
8fb759a
* 解决csv用office打开乱码的问题,写csv默认带上BOM数据
已经在最新版本修复
#3297 导出字节流也建议支持一下
No branches or pull requests
建议描述
使用版本是 3.1.0 ,在导入CSV 的时候出现了首列无法导入的问题,后来发现是 UTF-8 BOM 编码导致的,已经解决了,解决思路是在获取文件流后先处理bom标识,然后再处理数据的导入。建议官方将此功能集成到框架中。
核心代码如下
The text was updated successfully, but these errors were encountered: