unmappable character for encoding UTF8 when compiling by Eclipse [message #1730765] |
Thu, 28 April 2016 11:04 |
Albert Kao Messages: 11 Registered: April 2016 |
Junior Member |
|
|
Using DOS shell on Windows compile successfully, which show that my build.xml file, Ant, JDK setup and the Java source files are ok.
However, using Eclipse to compile (running the build.xml file as an Ant task) fail with the
"unmappable character for encoding UTF8" message.
The build.xml file originally has
<javac srcdir="${src}" destdir="${classes}" deprecation="on" debug="yes" target="1.6" source="1.6">
Then I change the build.xml by adding "encoding" to javac.
i.e.
The build.xml file has changed to
<javac srcdir="${src}" destdir="${classes}" deprecation="on" debug="yes" target="1.6" source="1.6" encoding="utf8">
which Eclipse compile with the same error.
However, change the build.xml with encoding="cp1252":
<javac srcdir="${src}" destdir="${classes}" deprecation="on" debug="yes" target="1.6" source="1.6" encoding="cp1252">
which Eclipse compile without any error.
I had already added "UTF-8" to the Default Encoding box in Eclipse for the following:
Window > Preferences > General > Content Types > Text
Window > Preferences > General > Workspace, set "Text file encoding" to "Other : UTF-8".
Please help.
Thanks.
|
|
|
Powered by
FUDForum. Page generated in 0.03385 seconds