MyEclipse and Eclipse Modify the encoding __ code

Source: Internet
Author: User
After MyEclipse new or imported items, some files in Chinese display garbled, each time in the project property to modify their code, so think of a one-time solution to all coding problems, so that the project is new or import automatically after the Utf-8 code, so you do not have to deal with the Chinese garbled problem every time, Here are the solutions found online:
First, modify the encoding problem in eclipse:
The code for the Eclipse default new project is GBK, and for the sake of coding support, the best unified requirement in the project team is UTF-8 coding.
Modifying the configuration of Eclipse allows the default encoding of Eclipse's new project to be directly UTF-8.
In the menu bar, change the Window->preferences->general->workspace->text file encoding to UFT-8.


This is one of the things you should do immediately after you install eclipse.

The same window->preferences->general->content types can modify the specific file in different formats of the default encoding, especially the Html,css,javascript file encoding is best to modify, Otherwise, the default iso-8859-1 cannot support Chinese.


Note: However, this modification is only valid for the current workspace, and if you are new or switched to a new workspace, you will have to do the same step.



Ii. Modify the file encoding problem in MyEclipse:
myeclipse6.0 How to unify all file encodings:

Windows---->preferences---->myeclipse---->file and editors----->jsp---> select the encoding in this directory as the encoding you want to set ( such as UTF-8).


In this way, the next time you create a new JSP page by default is the encoding you just set, because by default, a new JSP page encoding is iso8859-1, is not able to save Chinese, to save Chinese will have to manually change to Gbk,utf-8 support Chinese encoding, It is cumbersome to modify the code once for each new one. After the above settings, you can unify the entire project code without having to manually set it.

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.