Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

On Red Hat Enterprise Linux AS release 3,

I've set my environment variable as below

$ echo $LANG
zh_CN.UTF-8

$ echo $LANGUAGE
zh_CN.UTF-8

$ echo $SUPPORTED
en_US.UTF-8:en_US:en:zh_CN.UTF-8

$ locale
LANG=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

Meanwhile I've set PuTTY's transmission encoding as utf-8 and appearance->font setting to have a font as 'Fixedsys' which does support chinese.

However, when I try to print a file with Chinese, it can not print it correctly

$ cat 1.txt
hello▒▒▒ $

and I can not input Chinese correctly on shell.

share|improve this question

1 Answer 1

If you're using screen you must start it with the -U option in order to have utf8 support.

It seems like defutf8 on in your .screenrc should do this for you, but it won't.

share|improve this answer
    
I'm not using screen; i tried to run screen -U and cat 1.txt, it's still not printing it. –  hetaoblog Nov 5 '12 at 2:40
    
@hetaoblog Not sure then. The putty settings you've given allow me to produce Chinese characters if screen is not running, or with screen -U. Are you running some other program like tmux (which uses -u)? –  DerfK Nov 5 '12 at 17:06
    
I'm not running tmux. i just login putty and do the settings. on my personal linux, i modified /etc/sysconfig/i18n to set LANG/LANGUAGE/SUPPORTED/SYSFONT to include chinese characters and it worked; for the machine which i do not have permission to do so, I assume it should be fine to set the environment variables there. but it turned out not working... –  hetaoblog Nov 6 '12 at 4:07
    
@hetaoblog I think the best bet then is to try comparing env on both servers and figuring out what's different. I use Debian and can't find any good docs on what exactly the settings in /etc/sysconfig/i18n DO and how they are used, and I'm not finding anything there that should interfere. The settings in there don't seem to be environment variables though. I found a webpage that suggests that you can have per-user i18n settings in ~/.i18n so maybe you can try creating a file named that with those commands and logging out and back in again. –  DerfK Nov 6 '12 at 5:35
    
thx very much for your kind help. i tried to create the file but it did not work either. the 2 servers are in 2 different environment that i can not access at the same time. I'll try to look for some other ways. someone said i need to install something like 'zhcon' in order to support chinese, but this does not match with my personal experience on my personal linux server. –  hetaoblog Nov 7 '12 at 2:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.