|
发表于 2006-5-18 07:09:08
|
显示全部楼层
Post by 9122
[color="DarkOrange"]找到问题了,还是locale的关系,调整export LANG=zh_CN.GBK等等其他zh_CN的locale,直接显示中文都正常,在konsole下也正常了,如果是export LANG=zh_CN.utf8的话就不行,不知道是不是个体现象,但是为何精华以及搜索到的帖子中均推荐用zh_CN.utf8呢? 那是因为~/.fcitx/config采用的gbk编码,而你的系统为utf8!在kwrite里直接改编码是有效的,而konsole里(我想你是用vi的把),必须先修改vi的配置文件,让它可以自动选择编码。具体的可以参考我的配置文件。(注:我这个也是论坛里搜来的,要感谢原作者。)
~/.vimrc:
- " multi-encoding setting
- if has("multi_byte")
- "set bomb
- set fileencodings=ucs-bom,utf-8,cp936,big5,euc-jp,euc-kr,latin1
- " CJK environment detection and corresponding setting
- if v:lang =~ "^zh_CN"
- " Use cp936 to support GBK, euc-cn == gb2312
- set encoding=cp936
- set termencoding=cp936
- set fileencoding=cp936
- elseif v:lang =~ "^zh_TW"
- " cp950, big5 or euc-tw
- " Are they equal to each other?
- set encoding=big5
- set termencoding=big5
- set fileencoding=big5
- elseif v:lang =~ "^ko"
- " Copied from someone's dotfile, untested
- set encoding=euc-kr
- set termencoding=euc-kr
- set fileencoding=euc-kr
- elseif v:lang =~ "^ja_JP"
- " Copied from someone's dotfile, untested
- set encoding=euc-jp
- set termencoding=euc-jp
- set fileencoding=euc-jp
- endif
- " Detect UTF-8 locale, and replace CJK setting if needed
- if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
- set encoding=utf-8
- set termencoding=utf-8
- set fileencoding=utf-8
- endif
- else
- echoerr "Sorry, this version of (g)vim was not compiled with multi_byte"
- endif
复制代码 |
|