Have you written a bunch of Chinese comments in your IDE, but after opening it with vscode, you found a bunch of garbled characters. Or write it in vscode, and then open it in your own IDE, it will be a bunch of garbled characters. In fact, the coding method is different.
vscode has already provided us with a relatively simple solution.
1. Click File-->Preferences-->Settings,
2. Enter the search files:auto Guess Encoding as shown below:
Check this guess code. It's that simple! ! There have been no problems so far. Easy fix.