首页 > 系统服务 > 详细

Linux 中文字符集安装

时间:2020-10-11 08:50:22      阅读:139      评论:0      收藏:0      [点我收藏+]

查看当前字符集

$ echo $LANG
en_US.UTF-8

安装字符集

查看系统是否安装中文字符集支持

# locale -a | grep CN
bo_CN
bo_CN.utf8
ug_CN
ug_CN.utf8
zh_CN
zh_CN.gb18030
zh_CN.gb2312
zh_CN.gbk
zh_CN.utf8

若没有执行以下命令进行安装

#CentOS6.x:
yum groupinstall chinese-support
 
#CentOS7.x
yum install -y kde-l10n-Chinese
yum reinstall -y glibc-common
 
#定义字符集
localedef -i zh_CN -f UTF-8 zh_CN.UTF-8
 
#确认载入成功
locale -a

修改系统字符集

echo -e export LANG="zh_CN.UTF-8"\nexport LC_ALL="zh_CN.UTF-8" > /etc/locale.conf
source /etc/locale.conf

修改属主字符集

echo set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936 >> /root/.vimrc;echo set termencoding=utf-8 >> /root/.vimrc;echo set encoding=utf-8 >> /root/.vimrc

 

Linux 中文字符集安装

原文:https://www.cnblogs.com/zhanggaofeng/p/13796123.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!