vi /etc/sysconfig/i18n
添加:
LANG="zh_CN.UTF-8"
修改环境变量
cd ~
vi .bashrc
添加:
export LANG="zh_CN.UTF-8"
使用户配置生效
$ source .bashrc
验证用户字符集
$ 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= LC_ALL=