分页: 1 / 1
[问题]在putty中如何显示正常显示和输入中文?
发表于 : 2007-01-31 19:51
由 gydoesit
安装了ubuntu6.10,putty设置编码为UTF8,字体fixedsys或新宋体,登录后不能正常显示中文呀。
在fedora中就完全正常的。
看,怪不怪,显示?还能cd,还能mv,
root@www:/www/win/game/硬盘游戏# ls
????????????
root@www:/www/win/game/硬盘游戏# cd ????????????
root@www:/www/win/game/硬盘游戏/即时战略#
用vim和cat还不一样,文件长,只复制其中中文
root@www:/www/win/game/硬盘游戏/即时战略# cat /etc/samba/smb.conf
[游戏]
root@www:/www/win/game/硬盘游戏/即时战略# vim /etc/samba/smb.conf
[游▒~H~O]
更郁闷的是无法输入中文。在fedora中是没问题的
有人说用SSH secure shell,但我在里面没找到哪能设置utf8
在ubuntu中默认的LANG是C,但是即使把LANG,LC_ALL都设成zh_cn.UTF-8,也没作用。
不象在fedora中,如果想看gbk的中文文件名,设成zh_cn.GB2312就行了。哎。
发表于 : 2007-01-31 19:56
由 drongh
首先看你的系统是什么编码,用locale命令,然后设置putty的编码根你系统的要一致就可以了
发表于 : 2007-01-31 20:17
由 gydoesit
我上面说了,locale设成zh_cn.UTF-8不起作用!而且实际上也在部分显示中文
安装ubuntu6.10服务器版,简体中文,locale如下
root@www:~# locale
LANG=C
LANGUAGE=C
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=
我们现在设置一下
root@www:~# export LC_ALL=zh_cn.UTF-8
root@www:~# export LANG=zh_cn.UTF-8
root@www:~# export LANGUAGE=zh_cn.UTF-8
root@www:~# locale
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
LANG=zh_cn.UTF-8
LANGUAGE=zh_cn.UTF-8
LC_CTYPE="zh_cn.UTF-8"
LC_NUMERIC="zh_cn.UTF-8"
LC_TIME="zh_cn.UTF-8"
LC_COLLATE="zh_cn.UTF-8"
LC_MONETARY="zh_cn.UTF-8"
LC_MESSAGES="zh_cn.UTF-8"
LC_PAPER="zh_cn.UTF-8"
LC_NAME="zh_cn.UTF-8"
LC_ADDRESS="zh_cn.UTF-8"
LC_TELEPHONE="zh_cn.UTF-8"
LC_MEASUREMENT="zh_cn.UTF-8"
LC_IDENTIFICATION="zh_cn.UTF-8"
LC_ALL=zh_cn.UTF-8
结果没有任何区别
root@www:~# ls -l /www/win/game
total 4
drwxr-xr-x 3 win win 4096 Jan 31 17:18 ????????????
同样的putty设置,在fc中完全正常:
[root@www anonymous]# ls 中*
中文utf-8
发表于 : 2007-01-31 20:39
由 gydoesit
export LANG=zh_CN.UTF-8
之后已经可以正常显示中文了,但是还是没法输入:(
开始应该是我把zh_CN.UTF-8的CN搞成小写了吧
但是
root@www:~# dpkg-reconfigure locales
Generating locales...
en_US.UTF-8... up-to-date
zh_CN.UTF-8... up-to-date
Generation complete.
后依然保存不了设置,怎么才能保存设置,不用每次登录都改?我记得可以改用户目录下的文件,但我想对所有用户生效怎么办
发表于 : 2007-01-31 22:54
由 hualang0929
中文显示只要系统自带中文字符集就可以了,根本就不用你设置。
至于输入中文,修改 /etc/environment 加入一句
LC_CTYPE="zh_CN.UTF-8"
发表于 : 2007-02-09 18:58
由 gydoesit
楼上说的不对。根本不是那问题,我用普通用户登录竟然一切正常。原来是 /root下有.profile ,而普通用户竟然没有:(
其中有
LANG=C
LAGUAGE=C
我直接把/root/.profile删除了,一下就正常了:)
发表于 : 2007-02-10 1:27
由 xiaqin1983
why????
what's the reason???plz!!!!!!!
发表于 : 2007-02-10 1:28
由 xiaqin1983
op thell me why plz
发表于 : 2007-02-10 10:13
由 SuperWar3Fan
哈哈