Windows 10 CLI UTF-8 encoding

后端 未结 2 1918
情书的邮戳
情书的邮戳 2020-12-10 19:59

Problem:

On an english Windows 10 using slovenian keyboard layout, all command line interfaces seem to have a problem with displaying (printing) UTF-8 characters, n

2条回答
  •  误落风尘
    2020-12-10 20:19

    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
    

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

提交回复
热议问题