Search code examples
clojureincanter

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


It seems Incanter can only recognize utf-8 encoding file while native clojure slurp can read non-utf8 encoding file with :encoding keyword, So is it possible to combine those two functions together ,but I don't know how to do that!


Solution

  • first parameter could be filename, URL, or anything that could be handled by clojure.io/reader, so you can write something like:

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