Completely modify Eclipse's default encoding

Source: Internet
Author: User
Tags win32

Refer to predecessors experience to get a thorough revision of Eclipse default encoding method.

Setting up the encoding method in eclipse is very complex and easy to omit, after all the changes, some code generated template ${encode} variable is still the original encoding scheme, through the access to a lot of data obtained by the method summarized here.

First, modify the Eclipse boot configuration file, located in the Eclipse directory, the file name is Eclipse.ini

This method is the original address: http://sswilliam.blog.163.com/blog/static/189696383201310294232698/

Original content:

Individuals still like Utf-8 this charset.

all the projects have been made into this. The basic codec garbled problem solved the more than half. the other really garbled problem The basic idea is to take the initiative toward the UTF-8. basic can also be solved but one of the most annoying parts of Eclipse is The default charset is based on the system. if the Chinese system would be GBK, if the English system would be a cp2xxx code like that every time I get a new workspace, we have to adjust it manually. It's roughly the option of removing default on the Window>preferences>general>workspace Tex File encoding panel . then select Utf-8 in the dropdown list always wanted to fundamentally solve this problem. but there's no research . a project of today finally led me to solve this problem after viewing the source code discover that the default charset is actually obtained by System.getproperty ("file.encoding") and then there was a long search of where this file.encoding was initialized I didn't find it for half a day. a search on the Internet found that this is actually a global property of the JVM. It was the JVM that did it on its own when it started. the JVM defaults to the language of the read system If you want to modify to add parameters when the JVM is started -dfile.encoding=utf-8 is java-dfile.encoding=utf-8-jar [email protected]#$%^&* (   specifically for Eclipse. is to add a line-dfile.encoding=utf-8 in the Eclipse.ini file.
-startupplugins/org.eclipse.equinox.launcher_1. 0.201. R35x_v20090715.jar--launcher.libraryplugins/org.eclipse.equinox.launcher.win32.win32.x86_1. 0.200. v20090519-showsplashorg.eclipse.platform--launcher.xxmaxpermsize256m-vmargs-xms40m-xmx256m-Dfile.encoding  =utf-8

Ii. modifying individual settings in Eclipse preferences

Reference article: https://www.cnblogs.com/debiao/p/5721561.html

1, Window->preferences->general->content type, click to select Text, set the Utf_8 in the bottom (input box input UTF-8 and update). P.s.text expanded some files have already specified the default encoding, will not be affected by the text default encoding, if necessary, modify its default encoding and update. 2, Window->preferences->general->workspace, the right panel at the bottom of the text file encoding block from the default switch to other and select UTF-8.

P.S. There are no files that have not followed the settings after modifying the encoding settings as described above, and if there are any exceptions, please find a solution in the comments section.

1314233

Completely modify Eclipse's default encoding

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.