Home > Development Tools > VSCode > What should I do if vscode opens garbled characters?

What should I do if vscode opens garbled characters?

藏色散人
Release: 2019-11-11 09:37:37
Original
5317 people have browsed it

What should I do if vscode opens garbled characters?

What should I do if vscode opens with garbled characters?

VS code encoding settings/file garbled solution

First of all, by default, we use VS Code to open a utf-8 encoded file and a gb2312 encoded files. The gb2312 files were garbled during the period.

Recommended tutorial: vscode tutorial

VSCode usually defaults to UTF-8 encoding.

What should I do if vscode opens garbled characters?

One way is to click the encoding button in the lower right corner (UTF-8 in the picture), then select Operations and Reopen with Encoding

What should I do if vscode opens garbled characters?

Next, you can search in the supported encoding list. For this file that is already known to be encoded in GB2312, you can also type GB to search and click GB2312.

What should I do if vscode opens garbled characters?

Then the character encoding is normal after VSCode is refreshed. At this time, the encoding indicator in the lower right corner will change. At this time, the saved file will also be modified according to this encoding.

What should I do if vscode opens garbled characters?

Another method is to click File->Preferences->Settings, and then enter the user settings on the right:

"files.autoGuessEncoding ": true,

As shown in the figure, insert this line and save it.

What should I do if vscode opens garbled characters?

What should I do if vscode opens garbled characters?

After adding this setting, VSCode will try to guess the character set encoding when opening the file.

As shown in the picture, you can switch to a correct encoding without selecting the encoding yourself.

What should I do if vscode opens garbled characters?

The above is the detailed content of What should I do if vscode opens garbled characters?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template