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 Murach's Java Servlets and JSP this week in the Servlets 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: 41068
    
  43
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

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: The java compiler and encoding of sourcde file.
 
Similar Threads
Encoding in Java file
file name encoding problem
Reg :UTF 8
Java version in build file
Unicode issue(for Arabic)