This question has already been answered:

During the test, Russian letters are not displayed in the console, although CMD itself supports Russian characters, the system has Russian language installed.

There is a class

public class TestTest { @Before public void setUp() throws Exception { } @After public void tearDown() throws Exception { } @Test public void name() throws Exception { System.out.println("english"); System.out.println("русские"); } } 

console output:

  С:\..\ >echo "вваваы" "вваваы" >mvn test ..... ------------------------------------------------------- TESTS ------------------------------------------------------- Running TestTest english ╤А╤Г╤Б╤Б╨║╨╕╨╡ Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.056 sec .... 

coding console cp866. I tried to set different console encodings before launching - it did not help. Can you please tell me how to display Russian characters?

UPD

Running through Idea displays correctly.

ps it turned out that Idea automatically brings all messages to the human mind on the fly

UPD2 none of the answers helped. so the question is open.

Reported as a duplicate by members Pavel Mayorov , pavel , Bald , aleksandr barakin , Grundy Sep 30 '16 at 9:22 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

  • one
    Isn't Java displaying unicode by default? .. - pavel
  • @pavel, they just scored on windows. That would work in Linux ... Probably :) - Qwertiy
  • @PavelMayorov I tried these methods - it does not help. I feel that the problem is in the OS. On ideone.com, it works successfully with all encodings and without. - user214105
  • @sae I don’t know what you “tried” there - but a working worker - Pavel Mayorov
  • @sae so as not to read the coffee grounds - give what is displayed in the console in binary format. Redirect the output to a file - and open it in a hex editor. - Pavel Mayorov

2 answers 2

You can do this:

 System.setOut(new PrintStream(System.out, true, "<кодировка в которой будут отображаться символы к терминале>")); 
  • I tried several options - it does not help - user214105

Try switching the console to UTF-8 with the command chcp 65001 .

  • I tried it - it did not help - user214105
  • well means 1251 - Alex Chermenin
  • I immediately tried several. none helps - user214105