2014
2011-06-03 23:28:57 +08:00
我想我是解决了,你参考一下吧:
entered into VE 199
root@vps199:/# locale
LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
root@vps199:/# update-locale zh_CN.UTF-8 ///请忽略,我走歪路了
*** update-locale: Error: invalid locale settings: LANG=zh_CN.UTF-8
root@vps199:/# nano /etc/default/locale
root@vps199:/# update-locale zh_CN.UTF-8
root@vps199:/# date
Fri Jun 3 22:58:29 CST 2011
root@vps199:/# update-locale zh_CN.UTF-8
root@vps199:/#
root@vps199:/# dpkg-reconfigure locales
Generating locales (this might take a while)...
zh_CN.GB2312... done
zh_CN.GB18030...memory exhausted
done
zh_CN.GBK... done
zh_CN.UTF-8... done
Generation complete.
root@vps199:/# update-locale zh_CN.UTF-8
root@vps199:/# locale
LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
root@vps199:/# locale -a
C
POSIX
zh_CN
zh_CN.gb2312
zh_CN.gbk
zh_CN.utf8
root@vps199:/# update-locale zh_CN.utf8
root@vps199:/# locale
LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
root@vps199:/# export LANG=zh_CN
root@vps199:/# export LC_AL=zh_CN.utf-8 ///utf-8是小写的,我重试,不过还是歪路。。。LC_ALL我打成LC_AL,少个L,下面乱码就是这问题
root@vps199:/# locale
LANG=zh_CN
LC_CTYPE="zh_CN"
LC_NUMERIC="zh_CN"
LC_TIME="zh_CN"
LC_COLLATE="zh_CN"
LC_MONETARY="zh_CN"
LC_MESSAGES="zh_CN"
LC_PAPER="zh_CN"
LC_NAME="zh_CN"
LC_ADDRESS="zh_CN"
LC_TELEPHONE="zh_CN"
LC_MEASUREMENT="zh_CN"
LC_IDENTIFICATION="zh_CN"
LC_ALL=
root@vps199:/# date
2011�� 06�� 03�� ������ 23:06:14 CST ///貌似有点正常了吧
root@vps199:/# export LC_ALL=zh_CN.utf-8
root@vps199:/# date
2011年 06月 03日 星期五 23:08:11 CST
root@vps199:/# nano test.txt
root@vps199:/# cat test.txt
zhongwen 中文显示 中文输入 没问题吧
root@vps199:/#