免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 6376 | 回复: 1
打印 上一主题 下一主题

搞定:在WINXP下如何让cygwin支持中文及中文文件名 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-08-05 00:54 |只看该作者 |倒序浏览
搞定了,请版主加精吧。
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 (£ä&ouml 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 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2007-08-05 19:07 |只看该作者
哪位会编译/usr/share/lang下的文件,让cygwin不认为汉字是控制字符?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP