Echoing the conclusions of https://stackoverflow.com/a/17177904/14731, applications need to invoke WriteConsoleW
or chcp
in order to output unicode characters to the Windows console.
I don't want to use JNI so the WriteConsoleW
approach is out. Is it possible for a Java application to invoke chcp
on the console it is running inside of?
As far as I know, invoking Runtime.exec("cmd.exe", "/c", "chcp", "65001") will create a new console, change its code-page, and then kill the console. Meaning, the existing console won't be affected.