修改系统默认字符集

Centos 6 系统
[root@test ~]# vim /etc/sysconfig/i18n
LANG=“en_US.UTF-8”
#LANG=“zh_CN.UTF-8”

修改完成后使其生效
. /etc/sysconfig/i18n

Centos 7 系统
在CentOS 7以前的版本下,默认的字符集的路径一般保存在/etc/sysconfig/i18n文件中。但是在CentOS 7版本中,字符集配置文件位于/etc/locale.conf。
在修改该文件之前,可以先查看已经安装的语言包

[root@localhost stress]# locale -a
修改字符集
[root@localhost stress]# vim /etc/locale.conf
#LANG=“zh_CN.UTF-8”
LANG=“en_US.UTF-8”

修改后使其生效
[root@localhost stress]# . /etc/locale.conf
确认是否已修改
[root@localhost stress]# locale

猜你喜欢

转载自blog.csdn.net/bjgaocp/article/details/90168087