First, set the default encoding format of the new common type file, that is, the file saved format.
When the MyEclipse is not set, the default encoding of the saved file, generally with the Simplified Chinese operating system (such as windows2000,windowsxp) encoding consistent, that is, GBK.
In the Simplified Chinese system, the ANSI code represents the GBK encoding; in the Japanese operating system, the ANSI encoding represents the JIS code.
Window-->preferences-->general-->content Types
Expand each subkey in the right window and enter the encoding format, such as "UTF-8" and click "Update" to set it up.
For example: In the above settings, set the JSP default encoding format is "UTF-8", then the new JSP files are in "UTF-8" format saved.
Similarly, the Java default encoding format is "UTF-8", then the new Java files are saved in "UTF-8" format.
Set the HTML default encoding format to "UTF-8", then the newly created HTML file is saved in "UTF-8" format.
The above set the file save encoding format, the default mode of opening (decoding) will be the same as saving the encoding format.
Second, set the default encoding format for new files, that is, file save format.
In the first setting, only the encoding format of the common file type is set. If you create a new file without a suffix name, that is, the file type is not named, then MyEclipse cannot determine which encoding format to save, save the encoding format GBK with the operating system default file. This default save encoding format, can be modified as follows:
Window-->preferences-->general-->workspace on the right side of the Text file encoding->other Select UTF-8
Third, individual files view the encoding format (that is, the encoding format used to open the file) changes.
This method does not change the encoding format of the file, just tells the MyEclipse what encoding format to decode.
On the file to be viewed, such as file Test.java right-click-->properties-->resource on the right side of the text file encoding->other, you can modify it.
For example, you set the *.java file in the "one" in the encoded format "UTF-8", then you open the suffix named Java file, the default will be "UTF-8" format to decode. If someone has given you a well-written Java file, but he is saved with GBK code, then you now open the time, will show garbled. In this file right--->properties-->resource on the right side of the text file encoding->other->GBK, you can display the contents of the normal.
Iv. Single Project workspace default encoding settings.
On the project right--->properties-->resource on the right-hand text file encoding->other, can be modified.
MYECLIPSE Specifies the page Content data encoding format (which is the default setting of parameters) when writing a file, such as HTML, or JSP Web page before submitting the form, the user input information encoding format, configuration file XML parameter encoding format.
The main is to notify the browser or server, the transmission of data encoding format. Tell the browser what encoding to use to parse the HTML or JSP file.
Window-->preferences-->myeclipse-->files and editors--> Select the subkey-->encoding
For example: Select UTF-8,
When creating a new JSP file, contenttype= "text/html; Charset=utf-8 "pageencoding=" UTF-8 "will be generated automatically, without having to manually change it every time."
When creating a new HTML file, http-equiv= "Content-type" content= "text/html; Charset=utf-8 "
When creating a new XML file, <?xml version= "1.0" encoding= "UTF-8"?>
The Eclipse console displays the encoding used to inherit the workspace setting, which is the encoding format set in the "two" above.
The above is your own summary, if the error, please point out. The problem is as follows
1, if someone gave a project, the encoding format for GBK, I use the encoding format for UTF-8, import this project, display garbled, what needs to be modified?
I want to know where "must be changed". If I change all of the points above, the imported GBK-encoded project will be displayed as expected. But after the change, the code that looks at your own UTF-8-coded project will be garbled in Chinese.
In fact, the problem is how to get two project to use different encodings (such as UTF-8 and GBK), and all can be viewed normally without garbled characters.
2, open the written Java code, press right button-->general-->editors-->test editors-->spelling-->encoding What is this exactly what to use???
This and Window-->preferences-->general-->general-->editors-->test editors-->spelling--> Encoding modify the effect is the same, this is a global modification.
This setting inherits the global workspace encoding format by default, which is the encoding format set in "Two" above.
MyEclipse Chinese Characters