Debian / Ubuntu ---support UTF-8 locale/encoding

Posted on 2013-10-07 02:30 H2O 阅读(374) 评论(0)  编辑  收藏
Errors info is:
                        
locale: Cannot set LC_CTYPE to default locale: No such file or directory    
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory

Because you don't install UTF-8 support ,so that you can do this bellow to solved this problem:
# for english
apt-get -y install language-pack-en-base
# for chinese
apt-get install -y language-pack-zh-hans
apt-get install -y language-pack-zh-hans-base
apt-get install -y language-pack-zh-hant - translation
apt-get install -y language-pack-zh-hant-base

# if you wan't to support others you can search languages.
apt-cache search language-pack ,
so that you can get the language you want,remember the package name and install it to be okay.

# if you want set default encoding for system, you can edit /etc/environment

vi /etc/environment

# add content as bellow
LANG="zh_CN.UTF-8"
LANGUAGE="zh_CN.UTF-8:zh_CN.GB2312:zh_CN"
SUPPORTED="zh_CN.UTF-8:zh_CN:zh"
SYSFONT="lat0-sun16"
SYSFONTACM="8859-15"

#
dpkg-reconfigure locales


# reboot or let it
come into force now.

source /etc/environment # take effect now.
reboot # after you reboot machine ,default encoding to be what you edited.
vim /etc/default/locale 其中改为zh_CN
#check default encoding you can use a simple command.

date






只有注册用户登录后才能发表评论。


网站导航:
 

posts - 0, comments - 21, trackbacks - 0, articles - 101

Copyright © H2O