Home > Operation and Maintenance > CentOS > 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

王林
Release: 2020-05-23 09:57:52
Original
2687 people have browsed it

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
Copy after login

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
Copy after login

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
Copy after login

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

First check whether it is installed:

yum list installed | grep glibc
Copy after login

or

rpm -qa | grep glibc
Copy after login

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

yum reinstall glibc-common
Copy after login

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!

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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template