Home > Operation and Maintenance > CentOS > How to solve the problem that centos does not support Chinese

How to solve the problem that centos does not support Chinese

Release: 2020-03-25 15:10:16
Original
5607 people have browsed it

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
Copy after login

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=
Copy after login

2) Configuration file/etc/sysconfig/i18n

[root@xuexi ~]# vim /etc/sysconfig/i18n  //没有就新建一个
Copy after login

Add or modify two lines in the i18n file

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

Save and exit

[root@xuexi ~]# source /etc/sysconfig/i18n
Copy after login

Finally restart the server

3) Configuration file/etc/profile

[root@xuexi ~]# vim /etc/profile
Copy after login

Add a line

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

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!

Related labels:
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