Re: [OT]在Windows下寫BIG5編 碼的繁體中文文件,有什麽好的 方案

"小山" <[email protected]> Mon, 21 Jan 2008 20:58:11 +0800
Newsgroups gmane.comp.python.chinese
Message-ID <[email protected]>
" Encoding settings
if has("multi_byte")
    " Set fileencoding priority
    if getfsize(expand("%")) > 0
        set fileencodings=ucs-bom,utf-8,cp936,big5,euc-jp,euc-kr,latin1
    else
        set fileencodings=cp936,big5,euc-jp,euc-kr,latin1
    endif

    " CJK environment detection and corresponding setting
    if v:lang =~ "^zh_CN"
        " Use cp936 to support GBK, euc-cn == gb2312
        set encoding=cp936
        set termencoding=cp936
        set fileencoding=cp936
    elseif v:lang =~ "^zh_TW"
        " cp950, big5 or euc-tw
        " Are they equal to each other?
        set encoding=big5
        set termencoding=big5
        set fileencoding=big5
    elseif v:lang =~ "^ko"
        " Copied from someone's dotfile, untested
        set encoding=euc-kr
        set termencoding=euc-kr
        set fileencoding=euc-kr
    elseif v:lang =~ "^ja_JP"
        " Copied from someone's dotfile, unteste
        set encoding=euc-jp
        set termencoding=euc-jp
        set fileencoding=euc-jp
    endif
    " Detect UTF-8 locale, and replace CJK setting if needed
    if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
        set encoding=utf-8
        set termencoding=utf-8
        set fileencoding=utf-8
    endif
else
    echoerr "Sorry, this version of (g)vim was not compiled with multi_byte"
endif

把这段内容加到你的.vimrc文件里面去。。。。

在 08-1-21,Fluke<[email protected]> 写道:
> notepad不行。
>
> 之前我用的是exitplus。win下沒試過ulipad。這就試試。
>
> 也想試試gvim。不過win下,裝起來應該蠻複雜的把,是不是需要cygwin?
>
>
> On 1/21/08, Jiahua Huang < [email protected]> wrote:
> > 用 gvim, notepad++, ulipad 之类好点的编辑器
> >
> > 2008/1/21 fluke.l <[email protected]>:
> > >
> > >
> > > 我有個project.客戶要求是繁體中文寫的,之前是在 Linux
> > > 來做,locale-gen一下,然後對編輯器設置一下locale就ok了,寫BIG5的文件沒有困難。
> > >
> > >
> 現在在windows下,發現顯示的時候,都是用utf8,所以默認的big5的文件,在第二次打開的時候就變成亂碼了。每次打開以後,編碼都顯示為ansi(實際上是big5,用mleditor打開能用big5來查看,是正常的文字)。
> > >
> > _______________________________________________
> > python-chinese
> > Post: send [email protected]
> > Subscribe: send subscribe to
> [email protected]
> > Unsubscribe: send unsubscribe to
> [email protected]
> > Detail Info:
> http://python.cn/mailman/listinfo/python-chinese
>
>
>
> --
> Yours,
>   fluke
> [email protected]
> http://algo-field.com
> _______________________________________________
> python-chinese
> Post: send [email protected]
> Subscribe: send subscribe to
> [email protected]
> Unsubscribe: send unsubscribe to
> [email protected]
> Detail Info:
> http://python.cn/mailman/listinfo/python-chinese
>
_______________________________________________
python-chinese
Post: send [email protected]
Subscribe: send subscribe to [email protected]
Unsubscribe: send unsubscribe to  [email protected]
Detail Info: http://python.cn/mailman/listinfo/python-chinese