Home >Operation and Maintenance >CentOS >How to solve Chinese garbled characters in CentOS

How to solve Chinese garbled characters in CentOS

angryTom
angryTomOriginal
2020-03-18 11:46:437318browse

How to solve Chinese garbled characters in CentOS

How to solve Chinese garbled characters in CentOS

1. Check whether the Chinese language package is installed on your system. You can use the locale -a command to list all Available language environments:

#locale -a

Check if there are the following four items: (Recommended learning: MySQL Video Tutorial)

zh_CN.gb1830
zh_CN.gb232
zh_CN.gbk
zh_CN.utf8

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

yum install kde-l10n-Chinese

2. Modify the configuration files of i18n and locale.conf

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

LANG="zh_CN.UTF-8"
LC_ALL="zh_CN.UTF-8"

Then execute it to make the newly modified file take effect:

source/etc/sysconfig/i18n

Second, vim /etc/locale.conf

添加:LANG="zh_CN.UTF-8"

Execute it similarly to make the newly modified file take effect. The file takes effect

source /etc/locale.conf

This article comes from the PHP Chinese website, CentOS usage tutorial column, please pay attention to this column for more related tutorials!

The above is the detailed content of How to solve Chinese garbled characters in 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