Blogger Information
Blog 34
fans 1
comment 0
visits 57306
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
centos7 支持中文显示
Y的博客
Original
1737 people have browsed it

一、首先查看当前系统默认采用的字符集 命令:locale 或者echo $LANG,如果当初安装的时候已经选择了中文语言包的话,那么默认的就是UTF-8字符集

[root@localhost ~]# locale
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=
[root@localhost ~]# echo $LANG
zh_CN.UTF-8

 

二、SecureCRT的修改,选项→会话选项,将外观中的字符编码集修改为UTF-8即可,其他终端程序同理

 

三、如果在第一步中字符集显示出来是其他的,那么需要先安装中文包,命令:yum -y groupinstall chinese-support

安装后之后,修改字符编码配置,命令:vim /etc/locale.conf 将LANG="XXXX" 改为LANG="zh_CN.UTF-8",注意Centos7的字符集配置文件为/etc/locale.conf,如果是7之前的版本,应修改/etc/sysconfig/i18n,修改完之后记得reboot


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post