Eclipse imports other people's files with Chinese garbled characters

  1. Import the project: File->Import->General->Existing Projects into Workspace; browse the location of the project, and click "Finish" to complete the import.

    One-step solution to the problem of Chinese garbled characters when Eclipse imports other people's projects
  2. After the import is complete, you will find that the Chinese in the source file has become garbled, as shown in the following figure. This is because the encoding method of the project is different from the encoding method set in eclipse.

    One-step solution to the problem of Chinese garbled characters when Eclipse imports other people's projects
  3. One-step solution: Window->Preferences->General->Content Types, select Text->Java Source File in the right box, and add UTF-8 in Default encoding, click Update, and click "OK" to complete the operation. At this point, you will be surprised to find that the Chinese garbled problem of all files in the project has been solved! ! !

    One-step solution to the problem of Chinese garbled characters when Eclipse imports other people's projects
    One-step solution to the problem of Chinese garbled characters when Eclipse imports other people's projects

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325943406&siteId=291194637