We try to use Java and UTF-8 on Windows. The application writes logs on the console, and we would like to use UTF-8 for the logs as our application has internationalized logs.
It is possible to configure the JVM so it generates UTF-8, using -Dfile.encoding=UTF-8
as arguments to the JVM. It works fine, but the output on a Windows console is garbled.
Then, we can set the code page of the console to 65001 (chcp 65001
), but in this case, the .bat
files do not work. This means that when we try to launch our application through our script (named start.bat), absolutely nothing happens. The command simple returns:
C:Application> chcp 65001
Activated code page: 65001
C:Application> start.bat
C:Application>
But without chcp 65001
, there is no problem, and the application can be launched.
Any hints about that?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…