Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » unmappable character for encoding UTF8 when compiling by Eclipse
unmappable character for encoding UTF8 when compiling by Eclipse [message #1730765] Thu, 28 April 2016 11:04
Albert Kao is currently offline Albert KaoFriend
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.

Previous Topic:Run java program with unicode arguments in eclipse
Next Topic:Developing a AST parser plugin, but starting as a standalone first
Goto Forum:
  


Current Time: Sat Oct 12 03:39:35 GMT 2024

Powered by FUDForum. Page generated in 0.03385 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top