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
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.
After following @Andreas advice, i have further explored the issue and found a fix that works:
First force cmd to use chcp 65001 (UTF-8) following this link on superuser.
Secondly use the following command:
set JAVA_TOOL_OPTIONS =-Dfile.encoding=UTF-8