Home  >  Article  >  Development Tools  >  How to configure vscode to automatically identify file encoding? [Detailed picture and text]

How to configure vscode to automatically identify file encoding? [Detailed picture and text]

青灯夜游
青灯夜游forward
2022-06-09 19:36:443679browse

vscodeWhat should I do if I open a file with garbled characters? This article will introduce to you the method to solve the garbled code - configure vscode so that it can automatically identify the file encoding. I hope it will be helpful to you!

How to configure vscode to automatically identify file encoding? [Detailed picture and text]

Our vscode open files are utf-8 encoded by default. When we open other encoding files (such as gb2312), garbled characters will occur. [Recommended learning: "vscode introductory tutorial"]

How to configure vscode to automatically identify file encoding? [Detailed picture and text]

At this time we hope to see the normal code, click UTF-8# in the lower right corner

How to configure vscode to automatically identify file encoding? [Detailed picture and text]

## A window will pop up above, we click [Reopen with encoding] and it will display normally


How to configure vscode to automatically identify file encoding? [Detailed picture and text]

How to configure vscode to automatically identify file encoding? [Detailed picture and text] But the problem is not solved. When we open this file next time, it will still be garbled. This is because our editor does not automatically recognize the encoding of the file, and it will still use UTF-8 to open it next time.

In fact, vscode has its own recognition function and does not require any plug-ins. The method is as follows:

Open in sequence, File-"Preferences"Settings


How to configure vscode to automatically identify file encoding? [Detailed picture and text]

Then the setting interface will change. Search for [files.autoGuessEncoding] in the search box, and the setting item will appear. Just check it.


How to configure vscode to automatically identify file encoding? [Detailed picture and text]

For more knowledge about VSCode, please visit:

vscode tutorial!

The above is the detailed content of How to configure vscode to automatically identify file encoding? [Detailed picture and text]. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete