我正在使用 apache commons CSV 解析器将 CSV 转换为地图。在地图中,我无法通过 intellij 调试器读取一些值。如果我手动输入 map.get("key") ,则值为空。但是,如果我从地图中复制粘贴密钥,我将获取数据。无法理解出了什么问题。任何指针都会有所帮助。谢谢
这是我的 CSV 解析器代码:
private CSVParser parseCSV(InputStream inputStream) {
System.out.println("What is the encoding "+ new InputStreamReader(inputStream).getEncoding());
try {
return new CSVParser(new InputStreamReader(inputStream), CSVFormat.DEFAULT
.withFirstRecordAsHeader()
.withIgnoreHeaderCase()
.withSkipHeaderRecord()
.withTrim());
} catch (IOException e) {
throw new IPRSException(e);
}
}