vscode terminal garbled code
The VSCode terminal actually calls cmd.exe, so when Chinese garbled characters appear here What needs to be solved at this time is the encoding setting problem of cmd.
You can check the encoding settings of cmd through the chcp command. The code page number of GBK2312 is 936, and then change it to the encoding of utf-8. The corresponding code page number of utf-8 is 65001, so execute chcp 65001 to set the cmd encoding to uft-8, thus solving the garbled code problem
1. Check the original encoding
2. Execute the chcp 65001 command
For the above solution, you need to enter the command in the VSCode terminal every time: chcp 65001, This method is too troublesome. You have to enter commands every time you enter the terminal. Is there a permanent solution? Of course there is.
In VSCode, open "File" - "Preferences" - "Settings", then set in setting.json, and copy the following three lines into it:
{ "terminal.integrated.shellArgs.windows": ["/K chcp 65001 >nul"], // 以下两个可选 "terminal.integrated.fontFamily": "Lucida Console", "editor.fontSize": 18 }
/K chcp 65001 >nul means to set the encoding to 65001 when running cmd;
>nul means to avoid The console outputs information about modifying the encoding, otherwise it will output active code page: 65001;
The following two configuration files are optional:
editor.fontSize: 20 (modify the font size to 20);
terminal.integrated.fontFamily;"Courier New"(the font is changed to "Courier New").
Related recommendations: "vscode Usage Tutorial"
The above is the detailed content of vscode terminal garbled characters. For more information, please follow other related articles on the PHP Chinese website!

2022年了,该学会用VSCode debug了!下面本篇文章手把手带大家会习VSCode debug,希望对大家有所帮助!

本篇是VSCode配置文章,手把手教大家怎么在VSCode中配置使用 Geant4 和 Root,希望对大家有所帮助!

本篇文章扒拉一下vscode Prettier的选项,总结分享16个让你的代码变漂亮的属性,希望对大家有所帮助!

“工欲善其事,必先利其器!”,vscode作为前端开发的重要工具,其插件能大幅提升战斗力,精心收集12个插件,总有几款你还未曾拥有。

VSCode中如何开发uni-app?下面本篇文章给大家分享一下VSCode中开发uni-app的教程,这可能是最好、最详细的教程了。快来看看!

VScode中怎么开发置C/C++?怎么配置C/C++环境?下面本篇文章给大家分享一下Windows系统下VScode配置C/C++环境图文教程,希望对大家有所帮助!


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Dreamweaver CS6
Visual web development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool
