修改系统默认字符集

Centos 6 系统
查看当前系统字符集
echo $LANG
在这里插入图片描述
临时修改
LANG=ch_US_UTF-8
在这里插入图片描述

[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

命令修改方法:
[root@localhost ~]# cat /etc/locale.conf
LANG=zh_CN.UTF-8
[root@localhost ~]# localectl set-locale LANG=en_US.UTF-8
[root@localhost ~]# cat /etc/locale.conf
LANG=en_CN.UTF-8

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值