1. In Eclipse's run configurations, you can configure the console's encoding
Eclipse uses the MVN Clean Package command to execute.
When set to MS932, the following code, ① is the logger output of Logback, ② is the output of System.out, and ③ is a junit assertion.
Public void testApp () { asserttrue (true); Logger.warn ("Logger.warn testapptest:モック machine can が しています." "); System.out.print ("System.out.print testapptest:モック machine can が しています." "); = "str"; Assert.assertnull ("nullではありません. ", str); }
The results obtained, ①, ②, ③ are OK:
When set to UTF-8, only the ③ is OK when the result is obtained:
Using JUnit-related commands in eclipse, the resulting results are OK. No garbled. Seems to be unrelated to the encoding configuration.
2.Git Bash can set its encoding Character set
Git Bash executes the MVN clean package.
When encoded as Sjis, ①, ②, ③ are OK
When encoded as UTF-8, ①, ②, ③ are all Ng
Todo
Coding garbled problem in Java