When you first start using the Linux system, everyone will encounter a problem, that is, when the terminal input command is echoed, the Chinese characters are displayed as garbled characters. Why does such a problem occur? When such a problem occurs, how should we solve it? What's the solution? Today, the editor will tell you about the solution to Chinese garbled characters in Linux.
The steps are as follows:
1. How to view and set the system language package in Linux
1. View the current system language
After logging in to the Linux system and opening the operating terminal, enter echo $LANG to view the currently used system language. Such as
2. Check the installed language pack
To see if there is a Chinese language pack, you can enter the locale command in the terminal. If there is zh cn, it means that the Chinese language has been installed
3. What if there is no Chinese language?
You can download and install the Chinese language package yum groupinstall chinese-support from the Internet (if you cannot connect to the Internet, download it from other computers, upload it)
2. How to modify the system language to Chinese
1. Temporarily change the language
If you only temporarily change the language environment of the Linux system, you can set LANG=language name by inputting it, such as Chinese is
Zn_CN.UTF-8 (note that this is originally Chinese, I temporarily set it to English
2, Modify the system default language
The above method is to set the system default language configuration by modifying it
For example, Vi /etc/sysconfig/i18n (note to restart the system after changing it)
3. Other precautions
If you follow If the above method settings and modifications to the Chinese language still don’t work, pay attention to the encoding selected by your link terminal. For example, xshell, select Chinese or UTF8 for the terminal encoding. 4. After setting it up, try again. Check the previous garbled files and you will see that they are displayed in Chinese
The above is the entire content of the editor’s introduction to the solution to Chinese garbled files in Linux. Such problems are usually caused by the Chinese language package not being installed, or. There is a problem with the default language setting. You can try the above method to solve it!
Please pay attention to the PHP Chinese website for more related articles on how to solve the Chinese garbled code in Linux!

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

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Linux new version
SublimeText3 Linux latest version

Notepad++7.3.1
Easy-to-use and free code editor

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

Dreamweaver CS6
Visual web development tools
