IntelliJ idea Chinese garbled problem solution

Source: Internet
Author: User

I recently in the use of IntelliJ idea, found that always appear in Chinese garbled problems, found on the internet a lot of tutorials, found really "the world article a big copy." You might as well try to solve it yourself.

1, editor and debugging information Chinese garbled problem

Solution:

Choice: File->settings->editor->file Encoding

Then select UTF-8 at the right-hand IDE Encoding, and also select UTF-8 encoding at Project Encoding. In this way, the newly created file will be UTF-8 encoded in the form of a no longer in the case of garbled Chinese. If you open some files directly, at the same time, these two places have selected UTF-8 encoding, but there is still a Chinese garbled situation. At this point, it is possible because the newly added files are not UTF-8 encoded at the time of establishment, so the Chinese garbled situation will still appear. A straightforward workaround is to create a few new files under Idea, and then copy and paste the contents of the file you want to open directly into the idea new file.

2, idea other windows of Chinese garbled problem

As shown in the following:

The file opened in the diagram, or the Font display window, the Chinese characters have become garbled.

This occurs because the fonts provided by the Linux system do not support the display of Chinese, and in idea, the default is Ubuntu font, which does not support Chinese display. Therefore, you also need to download a font that supports Chinese display.

(1) Download fonts that support Chinese display

Search on the internet for a long time, many people recommend simsum fonts (online download is very convenient):

Where the SimSun folder contains the Simsun.ttf font file.

(2) Add the downloaded fonts to the System font Library

I'm here to add to the/usr/share/fonts/truetype folder, as shown below

(3) Restart idea

Restart idea, then select File->settings->appearance & Behavior->appearance as shown below:

On the right, tick the "Override default fonts by (...)" and select the SimSun font you just added in the "Name" option to display the Chinese language now. As shown below:

The problem has been solved perfectly.

IntelliJ idea Chinese garbled problem solution

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.