
How to write Chinese characters in vscode?
CMD under Chinese windows uses GBK encoding by default. Every time you need it, just enter the command: chcp 65001 in the VSCode terminal, and switch the code page to use UTF-8 to solve the Chinese code The problem is that this method is too troublesome. You have to enter a command every time you enter the terminal. Is there a permanent solution? Of course there is.
Recommended learning: vscode tutorial
Permanently change the console code page to VSCode to 65001:
Open the "File" in VSCode ”--"Preferences"--"Settings", then set it in setting.json, copy the following three lines into it:
{
"editor.fontSize": 18,
"terminal.integrated.shellArgs.windows": ["/K chcp 65001 >nul"],
"terminal.integrated.fontFamily": "Lucida Console",
}
/K chcp 65001 >nul的含义是在运行cmd的时候将编码设置为65001;
>nul是避免在控制台输出修改编码的信息,否则会输出active code page: 65001;At the same time, give away two easter eggs, for example:
editor.fontSize: 20(修改字体大小为 20); terminal.integrated.fontFamily:"Courier New"(字体修改为 "Courier New").
You can fill this in according to your own needs. Of course, you don’t need to write it if you don’t need it.
If the above method goes wrong, you can try the comment area below
"terminal.integrated.shellArgs.windows": ["-NoExit", "/c", "chcp 65001"]
Of course, if you can solve it by modifying GBK or UTF-8 on the lower right, there is no need to choose the above Two methods:

#I found that if it is changed to UTF-8, it is normal to run through Run Code, but when it comes to F5 debugging, the black box that pops up is garbled. , if it is changed to GBK, then F5 debugging will be normal and Run Code will be garbled. Anyway, you cannot have both. You can choose for yourself. To sum up, the Run Code operation is changed to UTF-8, and the F5 debugging operation is changed to GBK. Of course, this is not absolute. You also need to take a look at what is modified in "terminal.integrated.shellArgs.windows".
The above is the detailed content of How to write Chinese characters in vscode. For more information, please follow other related articles on the PHP Chinese website!
vscode running task shortcut keyApr 15, 2025 pm 09:39 PMRun tasks in VSCode: Create tasks.json file, specify version and task list; configure the label, command, args, and type of the task; save and reload the task; run the task using the shortcut key Ctrl Shift B (macOS for Cmd Shift B).
How to configure the environment for vscodeApr 15, 2025 pm 09:36 PMConfiguring a VSCode development environment consists of seven steps: installing the VSCode editor and language extensions. Configure the compiler path as needed. Set up debug configuration. Define code formatting rules. Install the Git Integration Extension. Install additional enhancements. Perform advanced configurations such as creating workspace settings and writing user scripts to automate operations.
How to write C code for vscodeApr 15, 2025 pm 09:33 PMSteps to write C code through Visual Studio Code (VSCode): Install C extensions; configure C compiler; create a new C project and create a main file; write C code; compile and run the code; simplify the encoding process using IntelliSense and debugger.
vscode c header file errorApr 15, 2025 pm 09:30 PMThe header file errors that occur when writing C code in Visual Studio Code are usually caused by the following reasons: 1. Path setting errors; 2. Header file spelling errors; 3. Header file version mismatch; 4. Dependency header file is missing; 5. Definition of header files is repeated. To resolve these errors, check and correct the include path, double-check the spelling error, confirm that the header version matches, include all necessary dependency header files, and make sure that the header files are not defined duplicately.
How to set vscode in ChineseApr 15, 2025 pm 09:27 PMThere are two ways to set up a Chinese language in Visual Studio Code: 1. Install the Chinese language package; 2. Modify the "locale" settings in the configuration file. Make sure Visual Studio Code version is 1.17 or higher.
vscode sets the header file pathApr 15, 2025 pm 09:24 PMTo set the header file path in Visual Studio Code, open the User Settings panel, add the path in the Include Path field, and click the Save button. Example: { "includePath": ["/path/to/header1", "/path/to/header2"] }.
How to install Chinese plug-in with vscodeApr 15, 2025 pm 09:21 PMSteps to install Chinese plug-in in VSCode: Search for "Chinese" in the extended market. Select and install the required plugins. The plug-in will be automatically enabled after installation. If you need to enable it manually, please click "Enable" in the plug-in list. After installing and enabling the plug-in, it is ready to be used.
What's wrong with Vs Code header file?Apr 15, 2025 pm 09:18 PMVs Code header file error reason: header file path error header file is not included, header file is too old compiler settings error code syntax error dependency missing Visual Studio Code version problem solution: header file correction path update header file check compiler settings fix code error Install dependency update Visual Studio Code


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 Linux new version
SublimeText3 Linux latest version

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

Dreamweaver Mac version
Visual web development tools

Atom editor mac version download
The most popular open source editor






