Skip to content
This repository was archived by the owner on Oct 14, 2020. It is now read-only.

Java files encoding currently accepts only ASCII #449

Closed
javatlacati opened this issue Jul 11, 2017 · 6 comments
Closed

Java files encoding currently accepts only ASCII #449

javatlacati opened this issue Jul 11, 2017 · 6 comments

Comments

@javatlacati
Copy link
Contributor

Related to changes for #383 I've seen a new error that says

Error: Command failed: javac -verbose -cp /home/codewarrior -d /home/codewarrior -sourcepath /home/codewarrior -cp /usr/local/groovy/lib/junit-4.12.jar:/usr/local/groovy/lib/hamcrest-core-1.3.jar /home/codewarrior/Kata.java /home/codewarrior/BonusTimeTest.java ./frameworks/java/CwRunListener.java
[parsing started RegularFileObject[/home/codewarrior/Kata.java]]
[parsing completed 26ms]
/home/codewarrior/BonusTimeTest.java:10: error: unmappable character for encoding ASCII

Tu support more than ASCII add -encoding utf-8 as param to javac program to accept utf-8 encoding.

Just in case you need another charset I'll drop this link

@javatlacati
Copy link
Contributor Author

Reviewed the code the problem is here on this line:

(def ^:private file-manager (byte-code-manager (.getStandardFileManager compiler nil nil nil)))

The current Java equivalent is:

private StandardJavaFileManager fileManager = compiler.getStandardFileManager(null, null, null);

And should be modified to something equivalent to:

private StandardJavaFileManager fileManager = compiler.getStandardFileManager(null, java.util.Locale.getDefault(), java.nio.charset.Charset.forName("UTF-8"));

or

private StandardJavaFileManager fileManager = compiler.getStandardFileManager(null, java.util.Locale.US, java.nio.charset.Charset.forName("UTF-8"));

Hoope it helps.

@javatlacati
Copy link
Contributor Author

@jhoffner
Copy link
Member

This should be covered by PR #447

@javatlacati
Copy link
Contributor Author

if you deployed to preview it didn't worked :/

@jhoffner
Copy link
Member

I haven't yet.

@jhoffner
Copy link
Member

OK #460 should resolve this specifically.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants