- 论坛徽章:
- 0
|
搞定了,请版主加精吧。
bash-3.2$ cd
bash-3.2$ pwd
/cygdrive/k/Documents and Settings/zsb.ZSB-CYIVMWJNCZ0
bash-3.2$ cat .inputrc
set meta-flag on
set convert-meta off
set output-meta on
set input-meta on
set kanji-code sjjs
bash-3.2$ cat .profile
PS4='+{$LINENO{FUNCNAME[0]}} '
export PS4
alias ls='/bin/ls --color=tty --show-control-chars'
alias less='/bin/less -r'
alias lf='/bin/ls -Fp --color=tty --show-control-chars'
alias l='/bin/ls -lF --color=tty --show-control-chars'
export LANG="ja_JP.SJIS"
export OUTPUT_CHARSET="sjis"
bash-3.2$ ls
Application Data Local Settings NetHood Templates ntuser.ini 桌面
Cookies My Documents PrintHood UserData t
ErrorLog.txt NTUSER.DAT Recent WINDOWS 「开始」菜单
Favorites NTUSER.DAT.LOG SendTo default.pls 工人
bash-3.2$
重点是.inputrc,ls要跟--show-control-chars
http://cygwin.com/faq/faq.using.html#faq.using.unicode
19. Why don't international (Unicode) characters work?
Internationalization is a complex issue. The short answer is that Cygwin is not Unicode-aware, so things that might work in Linux will not necessarily work on Cygwin. However, some things do work. To type international characters (£äö in bash, add the following lines to your ~/.inputrc file and restart bash:
set meta-flag on
set convert-meta off
set output-meta on
set input-meta on
set kanji-code sjis
These are options to the readline library, which you can read about in the bash(1) and readline(3) man pages. Other tools that do not use readline for display, such as less and ls, require additional settings, which could be put in your ~/.bashrc:
alias less='/bin/less -r'
alias ls='/bin/ls -F --color=tty --show-control-chars'
export LANG="ja_JP.SJIS"
export OUTPUT_CHARSET="sjis"
[ 本帖最后由 zhangshebao 于 2007-8-5 19:07 编辑 ] |
|