Three ways to set up encoding formats in eclipse

Source: Internet
Author: User

Turn from: 52403735

Heard a teacher long ago said: "We Chinese no matter what kind of programming language to learn, always encounter garbled problem." So you will certainly encounter coding problems in the process of using eclipse. Garbled occurs because of inconsistencies in the encoding and decoding formats. (For reasons of garbled characters, it is not introduced here)

Here are three ways to set the encoding format for eclipse:

First: Only the encoding format of the current *.java file is set

In the current *.java file, press ALT + ENTER to display the interface shown. You can see the option to set the encoding format (shown in the red rectangle). You can select the encoding format you want in the drop-down list. If not, you can also enter it manually. After setting up, click "Apply" to save the settings. Click "OK" to close the menu.

This setup encoding is only valid for the current single Java file.

the second type: Set the encoding format for a project project

Select one of your project project files, right click will appear as shown in the interface, select the bottom one of the options "Properties" (red rectangle style in the picture), click Enter.

Next, you will enter the interface as shown, and you can see the option to set the encoding. The following actions are the same as described in the first.

This encoding method is valid for all files in a project

The third type: Set the encoding format for the entire working range

Select the "Window" menu option and select "Preference" preferences. (as shown in the interface)

After entering, enter "ENC" (The English word "encoding") in the search box, as shown in the rectangular box. You will see all the options you have searched for. If you click on one of these options, you will see that the right half has the appropriate settings encoding option.

Here is an example of setting the coding for the work interval. Click "Workspace" to enter the interface as shown, you will see also the option to set the encoding format. Shown in the Red rectangular box in the figure.

This setup encoding is valid for all project files in the entire work span.

Remember to click "Apply" to make the settings effective after you've set up your encoding!

Remember that the second and third way to set the encoding is only valid for new files created after you set the encoding. That is, if you encode an existing project project or work area, all the files before you change the encoding settings are the original encoding format.

Three ways to set up encoding formats in eclipse

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.