Lyon's Blog
  • Home
  • Tags
  • Archives

locale

当在终端下执行某些操作,提示编码问题时,基本是因为终端的locale环境的编码不支持。

有些终端下默认的LC_*设置为C,可运行locale查看,也可查看/etc/default/locale, 此时终端环境的默认编码是ASCII。

可将其改为UTF8编码。

修改方式如下:

  1. 用locale -a命令查看系统支持的category。
  2. 在终端下进行export LANG=<category>,此时终端的LC_*变量发生了变化。 如果不想每次手动设置,可将export LANG=<category>加到.bashrc中。

    如:

    echo "export LANG=en_US.UTF-8" >> .bashrc
    
Comments
comments powered by Disqus

  • iptables »

Published

Dec 22, 2013

Last Updated

Feb 22, 2014

Tags

  • Bash 1
  • Linux 4

Contact

  • Powered by Pelican. Theme: Elegant by Talha Mansoor