How to solve Chinese garbled when comparing Git in VS Code?

as shown in the figure, click the modification logo to the left of the VS Code line number, which shows that all the Chinese characters in the file are garbled, and VS Code thinks they are different.

// html
// html

the same is true with the file comparison tool (magnifying glass) in the upper right corner.

searched on the Internet, all the garbled codes in the console were modified. I don"t know what to do in this situation. Ask for advice


is the encoding of the two saved files different?


after testing, I set the automatic guess encoding (true) in the setting of VS Code. As a result, VS Code got the encoding wrong.
cancel the guessing code and follow the default code urf-8.
"files.autoGuessEncoding": false,

Menu