On Mar 10, 2009, at 1:03 PM, David Andrews wrote:

One person suggested to me that "The code is probably doing something
odd with how it reads input, making bad assumptions about the codepage
being "ASCII". Running with ISO8859-1 as the file encoding usually
fixes this, but apparently not in this case."  I'm well out of my
depth here, and wonder if anyone has a suggestion on how I can
proceed?

Clojure's default stream for input (including REPL input) is set up to expect the input encoding to be UTF-8. Since all the characters in "(+ 1 1)" are 7-bit ASCII Characters and since all those characters are encoded identically in ASCII and UTF-8, Clojure is, effectively, expecting ASCII input in this case.

There was a request on the mailing list a month or two ago for Clojure not to specify UTF-8 as the encoding for its input stream which the poster suggested would allow it to accept the platform default input encoding. Perhaps that change would help here.

Note that Compiler/loadFile explicitly specifies UTF-8 as the encoding for Clojure source files as well.

The input stream encoding is set on line 175 of src/jvm/clojure/lang/ RT.java . Removing ", UTF8" from the InputStreamReader constructor would cause Clojure to use the platform's default character set rather than expect UTF8 or its ASCII subset.

                Var.intern(CLOJURE_NS, Symbol.create("*in*"),
- new LineNumberingPushbackReader(new InputStreamReader(System.in, UTF8))); + new LineNumberingPushbackReader(new InputStreamReader(System.in)));
 final static public Var ERR =


--Steve

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to