When the command line to see the git diff, met GBK encoded files, Chinese display will be garbled.
The reason: git diff output using less, but less does not support gbk coding
solutions: by git diff output into a support gbk editor on it
The following are unreasonable Editor to view git diff
approach.
Vim
git diff | vim -R -
MacVim
git diff | mvim -R -
Sublime
git diff | subl
TextMate
git diff | mate
vim coding used gbk
After opening the file with vim, vim is not recognized if the encoded file correctly, you can notify vim by using the following command to specify the encoding reload the file:
:e ++enc=<encoding>
fileencoding configuration items
The value of the vim configuration item is a coded list.
When vim to open a file, it will try to use it in the order