I use to commit my personnal projects with french messages, including UTF-8 accents.
I was working on these projects on a Linux Arch install, and then pulled them on another new Arch install.
But now when I want to look at the git log of one of these projects, it doesn't render the french accents correctly.
Example with a choosen commit:
$ git log -n1 --pretty=format:"%h %s" 8e72413
8e72413 Ajout<C3><A9> le param<C3><A8>tre TabStop
But when I pipe it with cat
, it works like a charm:
$ git log -n1 --pretty=format:"%h %s" 8e72413 | cat
8e72413 Ajouté le paramètre TabStop
It works well too when I read it using Vim, using the following similar command:
:r! git log -n1 --pretty=format:"%h %s" 8e72413
The same problem is happening if I use either xterm
or urxvt
, and my locale settings are well configured (as well with my old install on which I was working), with LANG=fr_FR.UTF-8
. Of course, my old Arch install is still working well, without this issue, with the same repository.
What did I miss? I really don't remember anything I could have done on my old install to make it work properly.
The problem is that my locale config was not so well configured :
I didn't see the important point :
LC_ALL
was not set tofr_FR.UTF-8
.EDIT:
Actually, the problem was more trivial than that : I just forgot that I added the following alias:
alias git='LANG=en_US.UTF-8 git'
Indeed, changing the value of
LC_ALL
is not a solution.I made this alias because
vim-fugitive
is not working well withgit
displayed in french language...