How to solve Linux Chinese garbled?

  
                

When you first started using the Linux system, everyone encountered a problem, that is, when the terminal input command was echoed, the Chinese displayed garbled characters. Why is there such a problem? With such a problem, how should we solve it? What is the solution? Today, Xiaobian will talk to you about the solution to the garbled Linux Chinese.

The steps are as follows:

First, Linux how to view the system language package

1, view the current system language

After logging in to the Linux system to open the operation terminal, Enter echo $LANG to see the system language currently in use. Such as

2, view the installed language package

Check if there is a Chinese language package can enter the locale command in the terminal, if there is zh cn means that the Chinese language has been installed

3 If there is no Chinese language

You can download the Chinese language package yum groupinstall chinese-support by online download (cannot be downloaded from other computers, upload it)

Second, how to modify the system language For Chinese

1 , Temporary Change of Language

If you only temporarily change the locale of the Linux system, you can set the LANG=language name by input, such as Chinese

Zn_CN.UTF -8 (Note that I was originally Chinese, I temporarily set it to English

2, modify the system default language

The above method is to modify the default language configuration of the system

Such as Vi /etc /sysconfig /i18n (note that the system is restarted after changing)

3, other notes

If you set the Chinese language according to the above method settings, it is not acceptable. Note the encoding of your link terminal selection.

For example, if xshell is used, select the Chinese encoding of the terminal, or UTF8.

4. After setting, check the previous garbled file again. You can see the display as Chinese

The above is the Xiaobian to introduce you to the Linux Chinese garbled solution. The problem is generally because there is no Chinese language package installed, or the default language set. There are problems. You can try the above methods to solve it! I hope to help you here.

Copyright © Windows knowledge All Rights Reserved