Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem of garbled codes in Intellij IDEA

2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces "how to solve the problem of Chinese garbled code in Intellij IDEA". In daily operation, I believe many people have doubts about how to solve the problem of Chinese garbled code in Intellij IDEA. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubt of "how to solve the problem of Chinese garbled code in Intellij IDEA"! Next, please follow the editor to study!

With regard to JAVA IDE development tools, the Eclipse series and Intelli IDEA are the main choices for most companies, and from the developer's point of view, Intellij IDEA seems to be more popular than the Eclipse series. When we use Intellij IDEA to develop, we find that the root cause of Chinese garbled is that the development tool does not match the coding format of the system environment. This paper uses the point of view of combining theory with practice to solve this problem thoroughly.

A reappearance of Intellij IDEA garbled problem

As shown in the following figure, Intellij IDEA shows garbled characters in Chinese.

Second, solve the problem

(1) problem identification

According to the Intellij IDEA console output, the Tomcat Catalina Log is garbled, so you can locate the problem to the Tomcat. So, let's see if there is garbled in the Tomcat console.

Sure enough, there was a problem with the Tomcat output.

(2) solve the problem

1. View the system code format, 936 code GB format

The following code page corresponds to the encoding format

Code page country or language United States 708 Arabic (ASMO 708) 720 Arabic (DOS) 850 languages (Latin I) 852 Central European (DOS)-Slavonic (Latin II) 855 Cyrillic (Russian) 857 Turkish 860 Portuguese 861 Icelandic 862 Hebrew (DOS) 863 Canada-French 865 Germanic 866 Russian-Cyrillic (DOS) 869 Modern Greek Thai (Windows) 932 Japanese (Shift-JIS) 936 China-simplified Chinese (GB2312) Korean (Big5) 1200 Unicode 1201 Unicode (Big-Endian) 1250 Central Europe (Windows) 1251 Cyrillic (Windows) 1252 Western European (Windows) 1253 Greek (Windows) 1254 Turkish (Windows) 1255 Hebrew (Windows) 1256 Arabic (Windows) ) 1257 Baltic (Windows) 1258 Vietnamese (Windows) 20866 Cyrillic (KOI8-R) 21866 Cyrillic (KOI8-U) 28592 Central European (ISO) 28593 Latin 3 (ISO) 28594 Baltic (ISO) 28595 Cyrillic (ISO) 28596 Arabic (ISO) 28597Greek (ISO) 28598 Hebrew (ISO-Visual) 38598 Hebrew (ISO-Logical) 50000 user-defined 50001 Auto Select 50220 Japanese (JIS) 50221 Japanese (JIS- allows one byte Katakana) 50222 Japanese (JIS- allows one byte Katakana-SO/SI) 50225 Korean (ISO) 50932 Japanese (automatic selection) 50949 Korean (automatic selection) 51932 Japanese (EUC) 51949 Korean (EUC) 52936 simplified Chinese (HZ) 65000 Unicode (UTF-7) 65001 Unicode (UTF-8)

two。 Solve the problem of garbled Tomcat output

Use Notepad++ to open the logging.properties file under the Tomcat installation source code conf folder.

The following are the contents of the file after being replaced with GBK

3. Restart Tomcat to solve the garbled problem

4. Sign in again, Intellij IDEA, the garbled code problem has been solved.

Three expansion

Some bloggers on the Internet offer the following solutions.

1. Set the file format. File= > Settings= > Appearance&Behavior= > Appearance

two。 Delete all encoding.xml files under the idea folder except utf-8

3. Set the Inllij idea file encoding format to UTF-8. File= > Settings= > Editor= > File Encodings

4. Configure Tomcat VM options value to:-Dfile.encoding=UTF-8

5. Sign in the Intellij idea installation directory and add at the end of the idea.exe.vmoptions and idea64.exe.vmoptions files in the bin directory

-Dfile.encoding=UTF-8

At this point, the study on "how to solve the problem of Chinese garbled code in Intellij IDEA" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report