Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The java compiler and encoding of sourcde file.

 
Tim McMurry
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Tim McMurry
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok,

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

Thanks for the reply

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic