Home > php教程 > PHP开发 > Does Linux display garbled characters in Chinese? How to set centos to display Chinese

Does Linux display garbled characters in Chinese? How to set centos to display Chinese

高洛峰
Release: 2016-12-15 16:21:55
Original
1347 people have browsed it

How to set the Chinese language of the Linux system? This is a problem that many friends will encounter when they start using Linux. When the terminal input command is echoed, the Chinese text displays garbled characters. This situation usually occurs because the Chinese language pack is not installed, or there is a problem with the default language set. Taking centos as an example, how to check the language, set and modify the language when operating Linux

Does Linux display garbled characters in Chinese? How to set centos to display Chinese

1. Check the current system language

After logging in to the Linux system and opening the operating terminal, enter echo $LANG to check the currently used system language. Such as

Does Linux display garbled characters in Chinese? How to set centos to display Chinese

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

Does Linux display garbled characters in Chinese? How to set centos to display Chinese

3. What if there is no Chinese language?

You can download and install the Chinese language package yum groupinstall chinese-support from the Internet

Does Linux display garbled characters in Chinese? How to set centos to display Chinese

After installation

Enter the locale command

Does Linux display garbled characters in Chinese? How to set centos to display Chinese

4. How to modify the system language to Chinese

1 Temporarily change the language

If To temporarily change the language environment of the Linux system, you can set LANG=language name by inputting it, such as zh_CN.UTF-8 for Chinese

2. Modify the system default language

The above method is to set the system default language configuration by modifying

such as vi /etc/sysconfig/i18n (Be careful to restart the system after making the changes)

Does Linux display garbled characters in Chinese? How to set centos to display Chinese

5. Other notes

If it still doesn’t work to modify and set the Chinese language according to the above method, pay attention to the encoding selected by your link terminal.

Take xshell as an example, select Chinese or UTF8 as the terminal encoding

Does Linux display garbled characters in Chinese? How to set centos to display Chinese


More Linux Chinese display garbled characters? For related articles on how to set centos to display Chinese, please pay attention to the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template