Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个用 GB18030 编码的 csv 文件,我想使用apache commons CSV来解析文件并获取文件中的汉字。
这个怎么做?因为我使用默认配置获得了一些有线字符。
谢谢
事实证明不是Apache Commons CSV包问题。这是java IO阅读器问题。
InputStreamReader isr = new InputStreamReader(new FileInputStream(file), Charset.forName("GB18030"));
使用 java 读取文件时使用指定的字符集会有所帮助。