wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes The java compiler and encoding of sourcde file. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "The java compiler and encoding of sourcde file." Watch "The java compiler and encoding of sourcde file." New topic
Author

The java compiler and encoding of sourcde file.

Tim McMurry
Greenhorn

Joined: Oct 31, 2009
Posts: 22
Hi,

I have a source file from a repository that causes a warning when I compile on my local machine:

"Unmappable character for encoding UTF8"

I have googled and found a "fix", which is to specify an encoding as an optional parameter when invoking the compiler.

However, I have always heard that Java sources could use Unicode, so whats up ?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41634
    
  55
javac can handle source files in just about any encoding, but it needs to be specified using the switch you found. I think the default is to assume US-ASCII encoding.


Ping & DNS - my free Android networking tools app
Tim McMurry
Greenhorn

Joined: Oct 31, 2009
Posts: 22
Ok,

then I get it, I assumed the claim about Unicode meant that the compiler itself would figure things out.

Thanks for the reply

 
Consider Paul's rocket mass heater.
 
subject: The java compiler and encoding of sourcde file.