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

Chinese characters under centos are always garbled

王林
王林Original
2020-03-31 11:53:481890browse

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

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"

Chinese characters under centos are always garbled

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

source/etc/sysconfig/i18n

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

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!

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