The general Java file Encoding format is UTF-8. The following is an example of changing the default GBK to UTF-8.
1. Change the encoding format for the entire workspace so that the newly created file is also the encoding format for the new settings.
Eclipse->window->preferences->general->workspacetypes->other->utf-8->ok
Chinese version:eclipse-> window, preferences, general--working space--Other->utf-8-> OK
2. Project-wide setup encoding format
Project->properties->general->resource->other->utf-8->ok
3. Encoding format for a type of file
Eclipse->window->preferences->general->content types-> Right find the type of file to modify (java,jsp, etc.), the default Encoding, enter Utf-8->update->ok in the input box
Chinese version:eclipse-> window, general----Content type--Select the type of file you want to modify, and then update the default encoding input,
4. Set the encoding format for individual files
In Package Explorer, right-click File--Properties, change the text file encoding format to UTF-8
Note: Change the encoding format before doing backup, you can also use the Encoding Format Batch conversion tool under the search for a lot of such gadgets under the web.
Eclipse Encoding Settings