idea build console display Chinese in garbled code

已回答

when run "gradle build" in terminal, Chinese characters are display correctly. But if I double click gradle build task in right panel, these characters are displayed in garbled code.

 

0

Make sure IntelliJ IDEA has the same file encodings with your terminal may solve this problem.

You can set Intellij IDEA's file encodings here:

Help | Edit Custom VM Options

-Dfile.encoding=UTF-8

replace UTF-8 with whatever file encodings you see in you Windows Terminal Settings.

-1
Avatar
Permanently deleted user

"-Dfile.encoding=UTF-8" solve the problem. Thank you.

0

 IntelliJ IDEA 2021.3 has the same problem,but -Dfile.encoding=UTF-8 did not solve my problem

0

@547913250 After adding it, you need to restart the IDE to make it work. Have you tried to restart the IDEA?

0

I restarted but it didn't take effect

0

Lejia Chen Plus this seems to be effective for maven but not for gradle

0

Lejia Chen Is there a problem with the 2021.3 version of the gradle plugin?

0

Lejia Chen I even restarted my computer but it still doesn’t work

0

@547913250 Please share a screenshot of the full IDE windows including that garbled code and the IDE log file from IDE main menu `Help | Show Log in ...`. You could upload them here https://uploads.jetbrains.com/ and share me the upload id.

0

Lejia Chen Upload id: 2021_12_22_SSEJSP6dmZqFinML (files: idea error.png, idea.log)

0

@547913250 Can you share the full IDE log (idea.log)? You could delete the idea.log, restart the IDE, share the new log file if you are worried about any sensitive info there.

0

Lejia Chen Upload id: 2021_12_23_4h5ZgwNif9SJYekY (file: idea.log)

0

请先登录再写评论。