I'm a beginning user of both Emacs and Clojure, testing my working environment with some simple text processing. I'm having problems getting the Slime REPL to properly print UTF-8 text stored in a vector.
I start by reading the contents of a file (a dictionary of Tocharian B) into a vector:
user> (def toch
(with-open [rdr (java.io.BufferedReader.
(java.io.FileReader. "/directory/toch.txt"))]
(vec (line-seq rdr))))
=> #'user/toch
I then try to get a line from the vector, and I get garbage:
user> (toch 44)
=> " Examples : /// kektseñe akappi ste ‘the body is an impurity’ (121b5), akappī = BHS aśuciṃ (529a3). "
I can enter the string into the Slime REPL and get it back as it should be:
user> " Examples : /// kektseñe akappi ste ‘the body is an impurity’ (121b5), akappī = BHS aśuciṃ (529a3). "
=> " Examples : /// kektseñe akappi ste ‘the body is an impurity’ (121b5), akappī = BHS aśuciṃ (529a3). "
And I can print to disk without any problem:
user> (binding [*out* (java.io.FileWriter. "test.txt")]
(prn (toch 44)))
=> nil
[Contents of test.txt: " Examples : /// kektseñe akappi ste ‘the body is an impurity’ (121b5), akappī = BHS aśuciṃ (529a3). "]
And getting lines from the vector from other REPLs (e.g. clj, lein repl) also works fine. It's only when I try to look at the contents of the vector within the Slime REPL that there's any problem.
What's going on here? Is there some miscommunication between Emacs and Swank? How can I fix this?