Monday, February 06, 2012

我的 Msysgit UTF-8 中文解決方案

1. git config

git config -e
[gui]
encoding = utf-8
[i18n]
commitencoding = utf-8
logoutputencoding = utf-8

2. bash profile
$ less ~/.profile
export TERM=ansi
export LESSCHARSET=utf-8
export GIT_PAGER=C:/cygwin/bin/less.exe
cd /g/EastPutWestPut/MyAsciiDocBook

3. vim setting
修改 {git home}/share/vim/vimrc,vimrc 最後加上

set fileencodings=utf-8

3.1 如果用vi開啟檔案顯示亂碼,在 vi 裡輸入:

:e! ++enc=utf-8

4.msys inputrc

{git home}\etc\inputrc 最後加上

set output-meta on
set convert-meta off

No comments: