Home > Article > Operation and Maintenance > How to solve the problem that centos does not support Chinese
centos does not support Chinese solution:
Recommended tutorial: centos usage tutorial
1. Check whether the system has Chinese installed Package
[xf@xuexi ~]$ locale -a |grep "zh_CN" zh_CN zh_CN.gb18030 zh_CN.gb2312 zh_CN.gbk zh_CN.utf8
If the above items are found, it means that the Chinese language package has been installed on the system and there is no need to install it again. If not, try the yum groupinstall "fonts" command.
(2). Modify the configuration file
1) Configuration file/etc/locale.conf
[root@xuexi ~]# cat /etc/locale.conf LANG="zh_CN.UTF-8" //改成自己需要的编码格式 [root@xuexi ~]# source /etc/locale.conf [root@xuexi ~]# LANG=zh_CN.UTF-8 LC_CTYPE="zh_CN.UTF-8" LC_NUMERIC="zh_CN.UTF-8" LC_TIME="zh_CN.UTF-8" LC_COLLATE="zh_CN.UTF-8" LC_MONETARY="zh_CN.UTF-8" LC_MESSAGES="zh_CN.UTF-8" LC_PAPER="zh_CN.UTF-8" LC_NAME="zh_CN.UTF-8" LC_ADDRESS="zh_CN.UTF-8" LC_TELEPHONE="zh_CN.UTF-8" LC_MEASUREMENT="zh_CN.UTF-8" LC_IDENTIFICATION="zh_CN.UTF-8" LC_ALL=
2) Configuration file/etc/sysconfig/i18n
[root@xuexi ~]# vim /etc/sysconfig/i18n //没有就新建一个
Add or modify two lines in the i18n file
LANG="zh_CN.UTF-8" LC_ALL="zh_CN.UTF-8"
Save and exit
[root@xuexi ~]# source /etc/sysconfig/i18n
Finally restart the server
3) Configuration file/etc/profile
[root@xuexi ~]# vim /etc/profile
Add a line
export LANG="zh_CN.UTF-8"
Save and exit, restart the server.
Recommended related video tutorials: linux video tutorial
The above is the detailed content of How to solve the problem that centos does not support Chinese. For more information, please follow other related articles on the PHP Chinese website!