简体   繁体   中英

Encoding problem in exception text output in IntelliJ IDEA

this is my first question here. I have not found a solution to my specific problem here. The error text in Russian is displayed incorrectly in the SpringBoot application. What have I tried:

  • Add

    <configuration> <executable>true</executable> <jvmArguments>-Dfile.encoding=UTF8</jvmArguments> </configuration>

in pom.xml

  • Add

    -Dconsole.encoding=UTF-8 -Dfile.encoding=UTF-8

in Help > Edit Custom VM Options.

  • Change project encoding and file encoding to UTF-8 in Settings.

In the screenshot, you can see how the same text is displayed in Postman and in the IDEA console.

I guess you are running your IntelliJ on Windows. Apparently UTF-8 has a bug there for cyrillic. Try to set the terminal to windows-1251: Bottom right in your screenshot is currently selected "UTF-8" click on that and under "more" you should be able to select windows-1251.

Source: https://intellij-support.jetbrains.com/hc/en-us/community/posts/206606945-Displaying-cyrillic-symbols-in-terminal

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM