Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Java7u3: error: unmappable character for encoding ASCII

Status
Not open for further replies.

rach18

Programmer
Feb 6, 2009
9
US
Hi,

My java program has a comment line as follows:

//Go on to the DMS Table LENLINES ~V Single Line Requirement.


While compiling using /usr/java/jdk1.7.0_03/bin/javac, i get the following error:

error: unmappable character for encoding ASCII //Go on to the DMS Table LENLINES ? Single Line Requirement.


It seems that the compiler is not ignoring the comments and the special characters in comments are the issue.
Please let me what the problem is and how can it be overcome?

Thanks.
 
The compiler doesn't understand the special character "~" in your comment. Most likely, you're "telling" javac to expect source files in UTF-8, when they're really in a single-byte encoding like ISO-8859-1 or windows-1252.
 
It's not compiling the comment. The compiler needs to read the whole file, even the comment lines, as it needs to know where the comments ends to keep compiling.

The easy way to solve it is removing the character.

Cheers,
Dian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top