问题
When I tried to compile (use javac)some java sources files include a comment line which has some unrecognized char like ascii code 129 (~A), error got.
The sources code looks like the following:
// ascii 129 is ? (Acutally it show ~A in VIM but show ? when I directly copy it here)
The above code line is a comment, it should not cause any error, but if it did, I think it should be a problem about the jave encode form, how can I solve this problem?
Thanks.
Wa
回答1:
Take a look at this answer. It worked for me, and I don't have to worry about it anymore :) https://stackoverflow.com/a/623036/971592
回答2:
Pick the correct encoding of the java source. UTF-8 would be a good requirements standard. One can use the open source editor JEdit to test which encoding the source actually is in. The java tool native2ascii can convert.
javac -encoding UTF-8 ...
来源:https://stackoverflow.com/questions/9661935/how-to-change-the-defaults-system-java-encode-form-in-windows