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.
我有一个场景,我必须从 csv 文件中读取/写入数据。我知道 csv 可以像文本文件一样被读取/写入。
我想知道的是,我如何处理字符集?例如,如果必须从中文 csv 文件中读取一段文本,那么我该如何阅读呢?
尝试以下操作:
BufferedReader br = new BufferedReader(new InputStreamReader(myFile.getInputStream(), "ISO-8859-15")); // Give your desired charset here