Wrong character encoding can prevent compilation
and1g opened this issue · 4 comments
and1g commented
At least with Linux, when the system locale is not set to UTF-8, compilation with ant may fail with several of these error messages:
[javac] /build/blackboard/src/blackboard_git/src/org/pmedv/core/util/StringUtil.java:229: error: unmappable character for encoding ASCII
[javac] text = text.replaceAll("??", "ae");
Setting the encoding to UTF-8 in build.xml will fix this issue.
Patch file: https://gist.github.com/and1g/6205536
and1g commented
Thanks for the commit, but the issue still exists but with an other file I missed on sunday. This is the whole build log:
Buildfile: /build/blackboard-git/src/blackboard_git/build.xml
init:
[mkdir] Created dir: /build/blackboard-git/src/blackboard_git/build
[mkdir] Created dir: /build/blackboard-git/src/blackboard_git/build/jar
compile:
[javac] /build/blackboard-git/src/blackboard_git/build.xml:27: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 1099 source files to /build/blackboard-git/src/blackboard_git/build/jar
[javac] /build/blackboard-git/src/blackboard_git/src/org/pmedv/core/util/URLUTF8Encoder.java:37: error: unmappable character for encoding ASCII
[javac] * Copyright ?? 1997 World Wide Web Consortium, (Massachusetts
[javac] ^
[javac] /build/blackboard-git/src/blackboard_git/src/org/pmedv/core/util/URLUTF8Encoder.java:37: error: unmappable character for encoding ASCII
[javac] * Copyright ?? 1997 World Wide Web Consortium, (Massachusetts
[javac] ^
[javac] /build/blackboard-git/src/blackboard_git/src/org/pmedv/core/util/URLUTF8Encoder.java:40: error: unmappable character for encoding ASCII
[javac] * This work is distributed under the W3C?? Software License [1] in the
[javac] ^
[javac] /build/blackboard-git/src/blackboard_git/src/org/pmedv/core/util/URLUTF8Encoder.java:40: error: unmappable character for encoding ASCII
[javac] * This work is distributed under the W3C?? Software License [1] in the
[javac] ^
[javac] 4 errors
BUILD FAILED
/build/blackboard-git/src/blackboard_git/build.xml:27: Compile failed; see the compiler error output for details.
Total time: 4 seconds
src/org/pmedv/core/util/URLUTF8Encoder.java has UTF-8 characters in the license description.
mpue commented
Should work now.
and1g commented
Still getting an error message for the ®-sign in line 40 but this should be the last issue. Thanks for the effort!
mpue commented
removed URLUTF8Encoder.java completely, since it is not used anyway. Should be fixed now