The method of converting all files to UTF-8 under Eclipse

Source: Internet
Author: User
UTF-8 needs to do the following:
1, Windows->preferences ... Open the Preferences dialog box, the left navigation tree, navigate to General->workspace, right text file encoding, select Other, change to UTF-8, and later create a new project. text file in its Properties dialog box Encoding is the UTF-8.

2, Windows->preferences ... Open the Preferences dialog box, left navigation tree, navigate to general->content Types, right context Types tree, point Open Text, select Java Source File, and in the following default Encoding enter UTF-8 in the input box, click Update, then set the Java file encoding to UTF-8. Other Java application development related files such as properties, XML, etc. have been specified by the Eclipse default, respectively, Iso8859-1,utf-8, such as in the development of the need to change the encoding format can be specified here.

3, after the above two steps, the new Java file is UTF-8 encoding, Eclipse compile, run, Debug is no problem, but do RCP application of the product output, or plug-in output, it is always error, or can not compile the pass (the output to be compile), Or the output of the plug-in run when the Chinese display garbled. At this point need to RCP application, or plug-in plugin engineering build.properties Add a line, javacdefaultencoding ... = UTF-8. UTF-8 encoding when the output is compiled to know the Java source file. This setting requires that all Java source files be UTF-8 encoded and, if not all, referenced in Eclipse Help (Plug-in Development environment Guide > Reference > Feature and Plug-in build configuration), it is recommended that all Java source files be UTF-8 encoded.


Source: http://blog.csdn.net/xy867497088/article/details/8050698

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.