(1) myeclipse Chinese comments garbled
Encoding Problems.
Click window-preferences-General-content types under text select the corresponding file type, then change the Page code to UTF-8 and then click Update.
In addition:
On the project root node Alt + enter, a window pops up, in the resource window select other as UTF-8
In fact, I don't understand the differences between the two places, but the comments are not garbled.
(2) solution for editing JS file garbled characters in myeclipse or garbled properties File
Choose "window"> "Preferences"> "general"> "content types"
Open the list in the window on the right, select "JavaScript", and enter "GBK" or "gb2312" in the input box on the right of "default encoding" and click "Update, open the JS file.
If no selection item is provided, add a "*. js" in the "File Association" below, and specify the encoding as "GBK" or "UTF-8 ".
For example. the properties file can also be used in the preceding method (in Java properites files), enter "GBK" or "gb2312" in the input box on the right of the default encoding ", and then click" Update, open again. properties file.
The following content is taken from: http://hi.baidu.com/zhanghaooy/blog/item/f91ec124d4b7ee20d40742a7.html
The reason why eclipse encounters garbled characters is that the encoding rules selected by the eclipse editor are variable. Generally, the default is UTF-8 or GBK, when an external import project, if the project encoding method and eclipse set the encoding method is different, it will produce Chinese garbled problem, there are several other cases.
If the encoding method of the imported project conflicts with that of Eclipse, all Chinese characters in this project are garbled; if the encoding methods of all projects conflict with those of the eclipse workspace, the Chinese characters in all projects may be garbled. For the eclipse workspace, eclipse saves your modified settings in the workspace settings file and modifies the encoding mode of a single project, eclipse will save the encoding method in the project. setting file package.
Therefore, there are two principles to avoid Chinese Garbled text:
(1) To avoid frequent changes to the workspace, it is recommended that the project be carried out in a workspace from the very beginning, in addition, it is best to set the encoding method of the workspace as the most frequently used or the project encoding method prescribed by the company, so that the project will use the encoding method of the workspace, avoid inconsistent codes;
(2) try to use the same encoding method for files of the same type to ensure that all files of the same type can use consistent encoding settings;
To solve Chinese Garbled text, you can set the following solutions:
(1) modify the workspace encoding method:
Window-> preferences-> General-> Workspace-> text file encoding
In others, select the desired encoding method and save it.
(2) modify the coding method of a single project:
Right-click the project and choose Properties From the shortcut menu"
Select Info (the first one) in the menu tree on the left of the new window, find text file encoding on the right, select "other", and select the encoding method in the drop-down box.
(3) modify the encoding method of a class of files:
If you want to set the JS file encoding method to UTF-8, you should
Window-> General-> content types
In content types, select JavaScript source file, select *. js in the file associations column, enter the UTF-8 in the default encoding column, click Update, and save.
(4) modify the encoding method of a single file: Right-click the file to be modified and select the last "properties" in the pop-up menu ", select Info (the first one) in the menu tree on the left of the new window, find text file encoding on the right, select "other", and select the encoding method in the drop-down box. This method is similar to modifying the engineering coding method.
PS: Another garbled problem encountered during the project is the font file of the operating system. In some cases, if the Chinese font of the system used by eclipse is damaged, it also causes the problem that Chinese characters cannot be displayed. Therefore, if the above settings cannot solve the problem, you should consider the problem of system font files.