How to change the defaults system java encode form in windows?

别说谁变了你拦得住时间么 提交于 2019-12-10 09:52:44

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!