Cygwin console输入、显示中文

首先需要在home目录($HOME、根目录)下新增或编辑两个档案:
输入vi ~/.inputrc 
在.inputrc中要有下面三行 
set meta-flag on 
set convert-meta off 
set output-meta on 

输入vi ~/.bash_profile 
在.bash_profile中要有下面三行 
export LESSCHARSET=latin1 
alias less='/bin/less -r' 
alias ls='/bin/ls -F --color=tty --show-control-chars'
重新启动cygwin,输入ls,看看这屏幕显示的中文和颜色 

如果对指令跟文本编辑器都不熟,请开启cygwin console,依序执行下面七个指令: 
cd (开启控制台)
echo "set meta-flag on" >> .inputrc 
echo "set convert-meta off" >> .inputrc 
echo "set output-meta on" >> .inputrc 
echo "export LESSCHARSET=latin1" >> .bash_profile 
echo "alias less='/bin/less -r'" >> .bash_profile 
echo "alias ls='/bin/ls -F --color=tty --show-control-chars'" >> .bash_profile 
然后退出cygwin console,再重新开启,就可以输入、显示中文了。
posted @ 2008-01-31 13:36  ShaDowiCool  阅读(1507)  评论(0编辑  收藏  举报