关于服务器编码问题:
1)查看编码:locale
方法1:
vi /etc/sysconfig/i18n
默认为:
LANG=“en_US.UTF-8”
SYSFONT=“latarcyrheb-sun16”
修改为:
LANG=“zh_CN.GBK”
SUPPORTED=“zh_CN.UTF-8:zh_CN:zh”
SYSFONT=“latarcyrheb-sun16”
方法2:vi /etc/profile
export LC_ALL=“zh_CN.GBK”
export LANG=“zh_CN.GBK”
方法2:
vi /root/.bash_profile文件,增加export LANG=zh_CN.GB18030
用source接路径,立即生效
本文详细介绍如何在服务器上设置中文编码,包括通过修改/etc/sysconfig/i18n、/etc/profile及/root/.bash_profile文件实现环境变量LANG和LC_ALL的配置,确保服务器能正确显示和处理中文。
3901





