1. Check whether the Chinese language pack is installed
Enter the following command to view the currently used system language
echo $LANG $LANGUAGE
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
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:
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!