Characters encoding wrong in terminal using git

混江龙づ霸主 提交于 2019-12-08 03:05:56

问题


Any time I try to make a "git diff" command to see a file change, it shows me problem in special characters, like accented ones, but if I see the file with "cat" it shows me everything ok. I am using Ubuntu 12.04 LTS.

ex:

WHERE  `T<C3><A9>cnico` IS NOT NULL

I tried to put these lines in .gitconfig, close terminal e open again, but still didn't work.

[i18n]
    logoutputencoding = utf8
    commitencoding = utf8

Anyone have other suggestion?


回答1:


Make sure of your git version.

For Ubuntu12.0.4 (precise), the package search for git indicates a:

git-core (1:1.7.9.5-1) 

And i18n issues have been addressed in git1.7.10+ (see "git, msysgit, accents, utf-8, the definitive answers").



来源:https://stackoverflow.com/questions/12534517/characters-encoding-wrong-in-terminal-using-git

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!