开发者

java load properties file path unicode

开发者 https://www.devze.com 2023-04-13 02:21 出处:网络
See following code, in the main method: System.out.println(args[0]); String PROP = args[0]; System.out.println(\"C:/测试\".equals(args[0]));

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

精彩评论

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

关注公众号