Home  >  Article  >  Operation and Maintenance  >  How to deal with Chinese garbled characters in the command line under centos

How to deal with Chinese garbled characters in the command line under centos

王林
王林Original
2020-05-23 09:57:522592browse

How to deal with Chinese garbled characters in the command line under centos

1. Check whether the Chinese language pack is installed

Enter the following command to view the currently used system language

echo $LANG $LANGUAGE

How to deal with Chinese garbled characters in the command line under centos

2. Next, check whether there is a Chinese language package.

Enter the following command. If there is "zh cn", it means that the Chinese language has been installed, as shown in the figure below:

locale

How to deal with Chinese garbled characters in the command line under centos

It should be noted that if there is no need to install the Chinese language pack, the specific installation steps are as follows:

1. Install the Chinese language pack

yum install kde-l10n-Chinese

2. Install (already installed To reinstall) glibc-common

First check whether it is installed:

yum list installed | grep glibc

or

rpm -qa | grep glibc

If installed, reinstall it so that you can take advantage of the first Chinese language pack for the first step:

yum reinstall glibc-common

3. Change the system to Chinese language

To permanently modify the system language, you need to modify the configuration file. Enter vim /etc/locale.conf to modify:

How to deal with Chinese garbled characters in the command line under centos

Recommended tutorial: centos tutorial

The above is the detailed content of How to deal with Chinese garbled characters in the command line under centos. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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