There are three levels of coding settings in Eclipse: global, project, and file.
The encoding of the file will override the encoding of the project, and the encoding of the project will override the global encoding.
My guess: Although your project encoding is changed to GBK, it is only effective for new files.
If the old file in the project is UTF-8 encoded, its encoding will overwrite the project encoding, that is, it will not be affected by the project encoding you set.
The solution is: Right-click on the file and set the encoding of the file in the file properties.
But if the file is originally encoded in UTF-8 and you forcibly change it to GBK encoding, the file will be garbled and the project will no longer be compiled.
The solution is: first save the file as GBK encoding, and then set its encoding in the file properties. Very troublesome.
Therefore, for an existing project, do not change its coding unless necessary.
There are three levels of coding settings in Eclipse: global, project, and file. The encoding of the file will override the encoding of the project, and the encoding of the project will override the global encoding.
My guess: Although your project encoding is changed to GBK, it is only effective for new files. If the old file in the project is UTF-8 encoded, its encoding will overwrite the project encoding, that is, it will not be affected by the project encoding you set. The solution is: Right-click on the file and set the encoding of the file in the file properties.
But if the file is originally encoded in UTF-8 and you forcibly change it to GBK encoding, the file will be garbled and the project will no longer be compiled. The solution is: first save the file as GBK encoding, and then set its encoding in the file properties. Very troublesome. Therefore, for an existing project, do not change its coding unless necessary.
For reference only.