解决centos7中文乱码
docker的centos7出现的乱码:#查看本地的中文语言包[root@61c1a2f92913 ~]# locale-aCPOSIXen_US.utf8[root@61c1a2f92913 ~]# localeLANG=LC_CTYPE="POSIX"LC_NUMERIC="POSIX"LC_TIME="POSIX"LC_COLLATE="POSIX"LC_MO...
·
docker的centos7出现的乱码:
#查看本地的中文语言包
[root@61c1a2f92913 ~]# locale -a
C
POSIX
en_US.utf8
[root@61c1a2f92913 ~]# locale
LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"`在这里插入代码片`
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
安装中文环境包(centos7)
yum install kde-l10n-Chinese -y
设置环境变量
vim /etc/profile
export LC_ALL="zh_CN.UTF-8"
更新环境变量
source /etc/profile
此时已经支持中文了
locale
LANG=
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"
设置locale.conf
vim /etc/locale.conf
LANG="zh_CN.UTF-8"
source /etc/locale.conf
设置系统语言
[root@61c1a2f92913 ~]# localedef -c -f UTF-8 -i zh_CN zh_CN.utf8
更多推荐
已为社区贡献1条内容
所有评论(0)