An error occurs when the following command is executed at Windows Command Prompt.
Commands
chcp 65001
java -Dfile.encoding=UTF-8 -Dsun.err.encoding=UTF-8 -jar server.jar nogui
Log output
2019-07-29 03:38:45,163 main ERROR Unable to inject fields into builder class for plugin type class org.apache.logging.log4j.core.appender.ConsoleAppender, element Console. java.nio.charset.UnsupportedCharsetException: cp65001
...
2019-07-29 03:38:45,172 main ERROR Unable to invoke factory method in class class org.apache.logging.log4j.core.appender.ConsoleAppender for element Console. java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.core.appender.ConsoleAppender
...
2019-07-29 03:38:45,226 main ERROR Null object returned for Console in Appenders.
2019-07-29 03:38:45,235 main ERROR Unable to locate appender "SysOut" for logger config "root"
This issue is not serious for most people, but I decided to report because of server quality.
Workaround
Specify the following command line argument when starting the server:
-Dsun.stdout.encoding=UTF-8
Confirmed for 1.19.2
There is currently no way to set the server's stdout encoding. Which means certain characters are printed as ? in the log file. The console window however does correctly display this.
Example text: "这种情况是油泵故障灯,检查一下油泵插头是否接虚,然后查一下油泵内管道压力是否符合正常值。"