Windows 安裝 cygwin + git package 解決中文亂碼問題

之前在 Windows上使用 Git 都是安裝 msysgit 或 git for windows ,但安裝更新為較新版的 Git for Windows 時,卻發生與使用之前的版本的 Git 建立的程式專案不相容問題。而且需要將舊專案UPGRADE到新版本的Git上。雖然新版1.7.10以上的Git 核心支援 Unicode,但是在 Bash 下無法輸入非  ASCII 的字元是一大問題(請參考下面兩段敘述)。

因此我變心了,改投 cygwin+git 的懷抱。在cygwin的操作環境下,安裝 git 套件 的確獲得較佳的 Unicode 編碼支援。不會在有中文輸入及顯示的問題發生在 git 的使用上。

from: https://github.com/msysgit/msysgit/wiki/Git-for-Windows-Unicode-Support

Git for Windows Unicode Support
As of V1.7.10, Git for Windows supports Unicode. Most importantly, this means that Git repositories with non-ASCII file names can now be seamlessly shared between Git for Windows and other Git flavors (i.e. Git on Linux/Mac, Cygwin-Git and JGit / EGit).

Unfortunately, it also means that users of previous Git for Windows versions need to update their Git settings, and probably need to migrate their Git repositories, too.

Known Issues Git for Windows

MSYS programs don’t fully support Unicode yet, e.g.
bash doesn’t let you type non-ASCII characters
ls converts non-ASCII characters to ‘?’ when printing to the console (redirecting to a file or another program works, though)
Tcl only supports BMP (Basic Multilingual Plane, i.e. Unicode characters \u0000 – \uffff), therefore gitk and git-gui currently don’t support e.g. CJK Extensions B – D.

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 變更 )

Twitter picture

You are commenting using your Twitter account. Log Out / 變更 )

Facebook照片

You are commenting using your Facebook account. Log Out / 變更 )

Google+ photo

You are commenting using your Google+ account. Log Out / 變更 )

連結到 %s