Encoding in eclipse

Source: Internet
Author: User

Http://kodak-zhou.iteye.com/blog/1004722


The general Java file encoding format is UTF-8. The following uses changing the default GBK to UTF-8 as an example.

1. Change the encoding format of the entire workspace. In this way, the newly created file will also be in the new encoding format.
Eclipse-> window-> preferences-> General-> workspaceTypes-> Other-> UTF-8-> OK
Finished: eclipse-> window-> preferences-> General-> Workspace-> Other-> UTF-8-> OK

2. Set the encoding format for the project scope
Project-> Properties-> General-> Resource-> Other-> UTF-8-> OK

3. encoding format of a certain type of file
Eclipse-> window-> preferences-> General-> Content Types-> Find the type of the file to be modified on the right (JAVA, JSP, etc.)-> In the following Default encoding, enter UTF-8 in the input box-> Update-> OK
Chinese version: eclipse-> window-> preferences-> General-> content type-> select the type of the file to be modified on the right-> enter the default encoding below-> Update

4. Set the encoding format for a single file
In package explorer right-click File-> Properties and change the text file encoding format to UTF-8

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.