有没有一种方便的方法可以将非 utf8 编码文件读入 incanter?

Is there a convenient way to read non-utf8 encoding file into incanter?

提问人:sage han 提问时间:5/12/2015 最后编辑:Alex Millersage han 更新时间:8/5/2016 访问量:262

问:

似乎 Incanter 只能识别 utf-8 编码文件,而原生 clojure 可以读取带有关键字的非 utf8 编码文件,那么是否可以将这两个功能组合在一起,但我不知道该怎么做!slurp:encoding

Clojure incanter

评论


答:

1赞 Alex Ott 5/13/2015 #1

第一个参数可以是 filename、URL 或任何可以由 处理的参数,因此您可以编写如下内容:clojure.io/reader

(read-dataset (InputStreamReader. (FileInputStream. "data/co2.csv") "ISO-8859-1"))