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