What to do if vscode utf-8 Chinese garbled code? 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 file. The gb2312 file was garbled during the period.
Recommended learning: vscode tutorial
VSCode usually defaults to UTF-8 encoding.
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
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.
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.
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.
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.
The above is the detailed content of What to do if vscode utf-8 Chinese garbled characters. For more information, please follow other related articles on the PHP Chinese website!

How to back up VS Code configurations and extensions? Manually backup the settings file: Copy the key JSON files (settings.json, keybindings.json, extensions.json) to a safe location. Take advantage of VS Code synchronization: enable synchronization with your GitHub account to automatically back up all relevant settings and extensions. Use third-party tools: Back up configurations with reliable tools and provide richer features such as version control and incremental backups.

By carefully building a Visual Studio Code (VS Code) development environment, programmers can greatly improve development efficiency. Key steps include: Selecting practical and stable extensions, such as Prettier, ESLint, and Python extensions. Use the workspace to set up a personalized editor to customize configurations for different projects. Master debugging skills and quickly locate and fix code errors. Choose a comfortable theme and appearance to enhance the development experience. Continue to learn and improve, and constantly explore ways to improve efficiency.

How to personalize your VS Code theme? Beyond simple background colors: choose the right theme, customize the color scheme, improve code readability and debugging efficiency. Advanced settings: Adjust fonts, formatting, code snippets and shortcut keys to create an exclusive workspace to improve coding speed and efficiency. Practice and debugging tips: Solve common problems (such as code highlighting and font blur), optimize settings to meet specific project needs.

To make VS Code shine, you need: Beautify the interface: Choose pleasing themes and icons such as One Dark Pro theme and Material Icon Theme. Improve encoding speed: Use code snippet extensions to speed up encoding, such as ES7 React/Redux/React-Native snippets, and create custom code snippets. Efficient version control: Proficient in using VS Code's Git integration, and use the Git command line tools to solve complex problems when necessary. Quickly locate problems: master the debugger, correctly set breakpoints and start programs, and shorten debugging time. Extension management: select only the extensions you really need

Beautifying JSON data in VS Code can be achieved by using the Prettier extension to automatically format JSON files so that key-value pairs are arranged neatly and indented clearly. Configure Prettier formatting rules as needed, such as indentation size, line breaking method, etc. Use the JSON Schema Validator extension to verify the validity of JSON files to ensure data integrity and consistency.

VS Code provides a powerful C development environment that improves development efficiency. When configuring, you need to pay attention to path issues, memory leaks and dependency management. Advantages include extended ecosystems, excellent code editing capabilities, and integrated debuggers, while disadvantages are extended dependencies and resource consumption.

Customizing fonts in VS Code can improve the coding experience. Selecting the right font, such as Consolas, Fira Code, or Source Code Pro, can improve readability. Setting the font includes modifying the font name, size, and line height. Avoid common pitfalls such as font rendering issues, special character displays, and font conflicts. Advanced tips include using code snippets and choosing a coordinated topic to further enhance readability and aesthetics. By customizing fonts, you can create a comfortable and efficient coding environment.

You can determine your VS Code version number in the following ways: "About" menu: In the menu bar, select "Help" > "About", and the version number will be displayed in the pop-up window. Command panel: Press Ctrl Shift P (Windows/Linux) or Cmd Shift P (macOS), enter "about" or "version" to select the option to display version information. package.json file: Locate the package.json file in the installation directory of VS Code, which contains version information.


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)

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

WebStorm Mac version
Useful JavaScript development tools

Atom editor mac version download
The most popular open source editor

Dreamweaver Mac version
Visual web development tools