且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Windows 10 CLI UTF-8 编码

更新时间:2023-11-27 13:38:10

使用 chcp 65001 然后用 java -Dfile.encoding=UTF-8 Test2 运行:>

Use chcp 65001 then run with java -Dfile.encoding=UTF-8 Test2:

chcp 65001
javac -encoding UTF-8 Test2.java
java -Dfile.encoding=UTF-8 Test2

记得在类名之后命名你的 Java 源文件,区分大小写.

Remember to name your Java source file after the class name, case-sensitive.