The Chinese garbled characters in eclipse are caused by the character encoding not matching the default encoding. There are many ways to solve it. You don’t need to install any plug-ins to solve it. . For different situations, different solutions need to be used. Here are some cases to explain how to solve the problem of garbled characters. The main idea to solve the problem of garbled characters is to set a correct and appropriate encoding. If you don’t know the original encoding of the target file, you can make some attempts. Usually, you can try GBK and UTF-8.
Set the character encoding of a single file to solve the problem of garbled characters in a single file
The encoding problem of third-party jar packages may be the most common problem. The solution is similar to that of a single file. In the Pakcage Explorer or Project Explorer view, right-click the third-party jar package – >Select "Properties"–>Set the corresponding encoding for the "Encoding" item.
##3
##4
Set the default character encoding for text files in the entire workspace
Often workspaces have a default character encoding. If most or all of your projects are in another encoding, then you can reset a default character encoding. There is no need to set the encoding for subsequent new projects. The steps are as follows: Windows–>Perferences–>General–>Workspace–>Test file encoding–>Set the corresponding encoding for “Other:”.
[Recommended course: Java video tutorial]
The above is the detailed content of How to quickly solve the Chinese garbled problem in eclipse. For more information, please follow other related articles on the PHP Chinese website!