| Author |
specifying character set when compiling
|
Kevin Tysen
Ranch Hand
Joined: Oct 12, 2005
Posts: 255
|
|
|
If I have a source file with String literals which are in Japanese, I want to make sure the String literals are read correctly by the compiler. How do I do that?
|
 |
Jeff Verdegan
Bartender
Joined: Jan 03, 2004
Posts: 5888
|
|
|
The javac command takes an optional -encoding argument.
|
 |
Kevin Tysen
Ranch Hand
Joined: Oct 12, 2005
Posts: 255
|
|
I saved my .java file (called JsBuild.java) in UTF8, then typed
javac -encoding UTF8 JsBuild.java
but then I got an error message in Japanese, which, translated to English, is something like this:
JsBuild.java:1: \65279 is an improper character.
?import java.io.BufferedWriter;
^
The first line of the file is an import statement, with no character in front of the word "import".
I assume that the question mark is there because the character \65279 cannot be displayed correctly.
But I have no idea how that character got there, or how to get rid of it.
|
 |
 |
|
|
subject: specifying character set when compiling
|
|
|