VSCode 为什么中文乱码

Posted by:

|

On:

|

这是代码编码不对

For example, if the file is saved in GBK (common in Chinese Windows systems), but VS Code tries to open it as UTF-8, you’ll see garbage like ���.

How to fix it

Open Command Palette: Ctrl+Shift+P

Search: Preferences: Open Settings (JSON)

Add this line:

jsonCopyEdit"files.autoGuessEncoding": true

Or explicitly:

jsonCopyEdit"files.encoding": "gbk"

Leave a Reply

Your email address will not be published. Required fields are marked *