使用locale查看当前使用的编码和字符集

locale

CentOS6 中/英文环境切换

使用locale -a查看当前支持的编码和字符集

locale -a | grep en_US #locale

-a会输出当前系统支持的所有编码和字符集,所以我这里使用grep只过滤en_US的字符集

CentOS6 中/英文环境切换

可以看到有en_US.utf8。一定要注意在第下一步修改中不要直接使用这里的en_US.utf8而要写成en_US.UTF-8形式,不然修改不生效系统会继续使用原先的中文编码。

在/etc/profile中修改LANG变量

echo ‘export LANG=en_US.UTF-8’ >> /etc/profile

在/etc/profile最后追加

reboot #重启操作系统

相关文章:

  • 2021-12-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-15
  • 2022-12-23
  • 2021-12-04
猜你喜欢
  • 2022-03-04
  • 2021-11-25
  • 2021-12-04
  • 2021-06-21
  • 2021-09-19
  • 2021-04-29
  • 2021-10-03
相关资源
相似解决方案