Modify Workspace default encoding
The encoding of the project file is inconsistent with your tool code:
On the menu navigation bar window-->preferences Open the Preferences dialog box, left navigation tree, navigate to general-->workspacewindows 7 platform default to GBK, Simplified Chinese operating system Windows XP, The default encoding for Windows 2000 Simplified Chinese is gb18030,linux platform defaults to UTF-8
Then the engineering code established in this workspace is GBK, and the Java file created in the project is also GBK.
Can see the default is the GBK encoding format, we modify to UTF-8 encoding format or you need the encoding format
Click Apply and click OK.
Modifying the encoding of a file
Sometimes we import project files, and do not import into our workspace, just a reference, this time if there is coding problem, we can modify the file encoding view.
Right-click on the Eclipse project file, select Properties, and in resource Select Modify encoding format
Modify the encoding of a file type
Sometimes we need some kind of file, such as: *.jsp, *.java, etc.
Navigation bar Window-->preferences
Open the Preferences dialog box, left navigation tree, navigate to Genera-->content Types
In the default encoding below, enter Utf-8->update->ok in the input box
To modify the encoding of a single file
In Package Explorer, right-click File--Properties, change the text file encoding format to UTF-8
Eclipse modifies the encoding format