I was able to reproduce an error involving Windows 7 and UTF-8 in a virtual machine with VirtualBox 4.3 (not sure if it is the issue that Alex experienced though):
* Installed Windows 7, then used Ninite.com to install Notepad++ (text editor), Oracle JDK 8 (1.8.0_45). Installed Leiningen 2.5.1 as .bat file from the website.
* Created a new leiningen project with "lein new app utf8test"
* Opened the file src/utf8test/core.clj in Notepad++ and replaced the contents of with the following:
(ns utf8test.core (:gen-class))
(defn saludo-año [año] (str "Saludos en el año " año))
(def saludo-japonés "どうもありがとう")
(defn -main [& args]
(println (saludo-año 2015))
(println saludo-japonés))
* On Notepad++ went to the Encoding menu and selected "Encoding in UTF-8 w/o BOM". Saved the file. When running "lein run" on the cmd.exe console it works but it outputs garbage instead of any non-ascii character (see
http://i.imgur.com/H0rngyq.png)
* To trigger the compilation error, change the encoding of the file in Notepad++ to "Encoding in UTF-8". Save the file. When running "lein run" this time it will not compile and complains about being unable to resolve a symbol (see
http://i.imgur.com/3SHegTH.png) ... however, if you type the contents of the file in the cmd.exe console (with "type src\utf8test\core.clj") you'll see there's some extra garbage chars before the namespace declaration.
My theory is that such garbage chars are the Byte Order Mark (BOM) Unicode character (
https://en.wikipedia.org/wiki/Byte_order_mark) and they are not being correctly handled in Windows somewhere in the stack.
I don't use Windows regularly and I never had UTF-8 issues on Linux though.
--
Denis Fuenzalida