vim can't display Chinese but gvim can
Hi,
I usually like use vim to edit source code, even in my X (fluxbox). One problem is, if in gvim I can see Chinese characters (as comments in some of my source code), but in vim (open in konsole terminal program), the same Chinese characters only displayed as unrecognized strange string. In both gvim and Konsole, I configured to use the same font, Bitstream Versa Sans Mono. I don't understand, with the same font setting, why gvim can display Chinese but konsole+vim can not. Where should I to check the error? Thanks in advance. - woody |
|
I've heard of a lot of problems with Konsole and unicode characters. I could be wrong, but I'm not sure that Konsole has full unicode support. If you don't know otherwise, you might want to try another terminal that we know does have it, such as rxvt-unicode.
|
1 Attachment(s)
I don't think there is something wrong with konsole. The OP may want to post an example file to demonstrate the problem if he really can't get rid of multi-byte characters from his source code.
|
Quote:
Another thing, then how do I change the (English) font used by rxvt-unicode? I prefer Bitstream Versa Sans Mono. |
Quote:
Code:
URxvt*font: xft:Bitstream\ Vera\ Sans\ Mono:style=roman:pixelsize=13:antialias=true:hinting=true Code:
$ xrdb -merge |
Quote:
http://kde.6490.n7.nabble.com/Bug-74190-Console-Unicode-support-not-100-there-td1251526.html Quote:
https://wiki.archlinux.org/index.php/Rxvt-unicode |
3 Attachment(s)
Quote:
Below are some screenshots related to the topic. Do you have a clue about the problem? Thanks. |
1 Attachment(s)
Quote:
|
Another very strange thing is: the urxvt can display Chinese only when it is started from Konsole! If I start it directly (from fluxbox 'run' command or from fluxbox menu), it cannot display Chinese. What's wrong? Thanks.
|
Did you ever edit your /etc/profile.d/lang.sh file before this? In order to support Unicode text, I believe you need to edit that file and change the line that says
Code:
# en_US is the Slackware default locale: Code:
# en_US is the Slackware default locale: |
Quote:
On the other hand, even urxvt can display Chinese in previous locale setting (I have to run it with 'bash -l -c urxvt'), but it font rending is really poor than Konsole. Konsole looks more nice to me. |
Quote:
|
Quote:
I think the best way to avoid encoding problems is to not use multi-byte character in C source code but use "gettext". If you really have political problems (e.g. your boss forces you to embed Chinese in C source code), please use the UTF-8 encoding, and set your locale to zh_CN.UTF-8. |
Quote:
|
All times are GMT -5. The time now is 04:26 PM. |