Home > Operation and Maintenance > CentOS > Chinese characters under centos are always garbled

Chinese characters under centos are always garbled

王林
Release: 2020-03-31 11:53:48
Original
1981 people have browsed it

Chinese characters under centos are always garbled

First check whether the Chinese language pack is installed on your system. You can use the locale -a command to list all available locale environments:

Chinese characters under centos are always garbled

Check if there are the following four items:

Chinese characters under centos are always garbled

If there is, there is no need to install it. If not, you need to reinstall it.

The command is as follows:

yum install kde-l10n-Chinese
Copy after login

Chinese characters under centos are always garbled

(Recommended tutorial: centos tutorial)

Then modify i18n and locale. conf configuration file

1, vim/etc/sysconfig/i18n, add the following two lines of code in it:

LANG="zh_CN.UTF-8"
LC_ALL="zh_CN.UTF-8"
Copy after login

Chinese characters under centos are always garbled

Then execute it to make the The modified file takes effect:

source/etc/sysconfig/i18n
Copy after login

2, vim /etc/locale.conf

Add: LANG="zh_CN.UTF-8"

Chinese characters under centos are always garbled

Chinese characters under centos are always garbled

Execute the same operation to make the newly modified file take effect:

source /etc/locale.conf
Copy after login

Recommended related video tutorials: linux video tutorial

The above is the detailed content of Chinese characters under centos are always garbled. For more information, please follow other related articles on 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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template