1)说明:

Windows的默认编码为GBK,Linux的默认编码为UTF-8。在Windows下编辑的中文,在Linux下显示为乱码。为了解决此问题,修改Linux的默认编码为GBK。
2)查看支持的字符集:

# locale -a

Centos中文乱码的解决方法


3) 安装英文版默认的字符集配置为:
# cat /etc/sysconfig/i18n
LANG="en_US.UTF-8"
SYSFONT="latarcyrheb-sun16"

4) 修改为中文字符集:
# vi /etc/sysconfig/i18n
LANG="zh_CN.GBK"
SUPPORTED="zh_CN.UTF-8:zh_CN:zh"
SYSFONT="latarcyrheb-sun16"

Centos中文乱码的解决方法
Centos中文乱码的解决方法
 
5) 执行如下命令或者重启即可生效。

# source /etc/sysconfig/i18n

相关文章:

  • 2021-08-16
  • 2021-12-03
  • 2021-12-25
  • 2021-12-19
  • 2021-10-29
  • 2021-06-20
  • 2022-01-12
猜你喜欢
  • 2021-12-27
  • 2021-12-30
  • 2021-12-23
  • 2022-12-23
  • 2021-07-12
  • 2022-12-23
相关资源
相似解决方案