开发者

java load properties file path unicode

See following code, in the main method:

System.out.println(args[0]);
String PROP = args[0];
System.out.println("C:/测试".equals(args[0]));

I am running the program in Eclipse. When running the program, I added

C:/测试

into the program arguments.

Here is the result:

C:/??
false

Why it is false? How to add encoding when loading a开发者_JAVA技巧 cmd arguments?


Your shell should be able to parse those command line arguments and pass it to the Java process using the respective charset. Looks like your dos prompt isn't able to do that.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜