Given this, any strings that contain non-ascii unicode characters are
generally read incorrectly (and in varying ways on different
systems). Either Clojure needs to watch for a per-file encoding
indicator in a special comment at the top of each file (ick!), or it
should just use a reasonable default. I would absolutely suggest and
prefer the latter, with UTF-8 as the default (UTF-8 being widely
supported, very functional, and the closest to a semi-standard file
encoding, at least in the programming circles I travel in).
Attached is a patch that makes the necessary changes that result in
UTF-8 being used as the encoding for all Clojure file loading; this
portion is (I think) exactly right. The patch also applies UTF-8
encoding to all repl input and output, which I'm slightly less sure
of -- it works nicely on my system (OS X w/ JDK 1.5), but there may
be details about how encodings are applied to console input and
output that I'm not accounting for here. Comments welcome.
Cheers,
- Chas
>
> +1 for UTF-8.
>
> user=> (def π Math/PI)
> #'user/π
> user=> π
> 3.141592653589793
>
> But my Emacs font can't render that. :(
> -Stuart
/me relaxes in the comfortable embrace of enclojure / NetBeans. ;-)
- Chas