There seems to be two separate issues regarding character sets in Clojure:

1) What encoding should clojure use to read/write to *in*, *out*, and *err*?

2) What encoding should clojure's use to load .clj files.


For 1) Clojure currently uses UTF-8 - this is hardcoded in the constants for 
those vars in RT.java.
I suppose there is no guarantee what encoding stdout is expecting, but the 
platform default encoding seems 
a better bet.  It might not always be correct - eg people might pipe the output 
of a Clojure script to a 
file, or they might be using a console that uses a non-default encoding.

I notice that some tools, eg cmd.exe, allow the caller to specify the encoding 
of stdin/out via a command-
line flag.

In Clojure, I suppose, if an application really does want to write unicode to 
stdout, then it is just a 
matter of rebinding *out* first to wrap System.out with a reader with the 
prefered encoding.


For 2) I think that it is good for Clojure to pick a fixed encoding for loading 
clojure files.  It is much 
nicer to create portable code, rather than have .clj files that fail to load on 
a server because the 
server happens to have a different platform default encoding.

So, I'd like to see the constants in RT.java changed to not specify UTF-8, but 
for the encoding used by 
the compiler to continue to specify UTF-8.

Anyone have any opinions?

-- 
Dave


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to