How do I set the encoding format for eclipse?

Source: Internet
Author: User

If you want to enable plug-in development applications to have better internationalization support, to maximize the support of Chinese output, it is best to make Java files using UTF-8 encoding. However, the default character encoding for the Eclipse workspace (workspace) is the operating system default encoding, and the default encoding for the Simplified Chinese operating system (Windows XP, Windows 2000 Simplified Chinese) is GB18030, The engineering code established in this workspace is GB18030, and the Java file created in the project is GB18030.

The eclipse default code for new projects is GBK, which modifies the configuration of Eclipse to make the default encoding of Eclipse's new project directly UTF-8 the menu bar window->preferences->general-> Workspace->text file encoding changes it to UFT-8. This is one of the things that should be done immediately after you install eclipse. But this modification is only valid for the current workspace, and if you are new or switched to a new workspace, you have to do the same step.

If you want to enable plug-in development applications to have better internationalization support, to maximize the support of Chinese output, it is best to make Java files using UTF-8 encoding.

So how do you set it?

1. Window-> Preferences-> general-> Workspac-> Text file encoding

Select other to change the encoding to UTF-8 so that the text file encoding in the Properties dialog box for the new project is UTF-8.

2, Window-> Preferences-> general-> Content Types

Select the text tree, click Open, select Java Source file, enter UTF-8 in the default encoding input box below, and press the Update button to set the Java file encoding to UTF-8.

(Note: Java application Development related files such as: properties, XML, etc. have been specified by the Eclipse default, respectively, Iso8859-1,utf-8, such as the development of the need to change the encoding format can also be specified here.) )

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.