Chinese garbled is caused by inconsistent encoding format.
1, into Eclipse, import a project engineering, if the project file encoding and your tool code inconsistent, will cause garbled.
2, if you want to enable plug-in development applications to have better internationalization support, to maximize the support of Chinese output, it is best to make Java files using UTF-8 encoding.
3. Modify the default encoding:
On the menu navigation bar window-->preferences Open the Preferences dialog box, the left navigation tree, and navigate to General-->workspace.
Windows 7 Platform defaults to GBK, the Simplified Chinese operating system Windows XP, Windows 2000 Simplified Chinese default encoding is the Gb18030,linux platform default to UTF-8, then the engineering code established in this workspace is GBK, The Java files created in the project are also GBK.
you can see the default is the GBK encoding format, modified to UTF-8 encoding format or the required encoding format, click Apply, click OK.
4, sometimes need some kind of file, such as: *.jsp, *.java, etc.,
navigation bar window-->preferences,
Open the Preferences dialog box, navigate to the left navigation tree, navigate to genera-->content Types,
On the right, find the type of file you want to modify, take *.java as an example,
in the default encoding below, enter Utf-8->update->ok in the input box
5, modify the encoding of individual files: In the Package Explorer right click on the file--Properties, change the text file encoding format for UTF-8.
after the above steps, the new Java file is UTF-8 encoded, the new project is also UTF-8 encoding, in Eclipse compile, run, Debug is not a problem.
Precautions :
Please keep the code consistent, otherwise it will cause garbled, in Java development is generally dominated by UTF-8.
you can back up the code before you convert it.
MyEclipse Java file garbled problem solved