Search code examples
gitterminalzsh

Git Log not showing accents


I'm having some trouble when displaying the Git logs for my repository. If I try from Terminal.app + Zsh it will display something like this:

commit 0edd34498e630...a70c7f
Author: Gustavo Ramos <[email protected]>
Date:   Thu Jun 27 21:22:43 2013 -0300

removendo "meta" e "metas", j<C3><A1> que esses foram deprecados a favor do modelo "target"

While the "correct" thing to show would be - and I've copied this from SourceTree:

Parents: 33176be00c
Author: Gustavo Ramos <[email protected]>
Date: June 27, 2013 9:22:43 PM GMT-03:00
Labels: HEAD fix-schema-file

removendo "meta" e "metas", já que esses foram deprecados a favor do modelo "target"

I've already set the terminal encoding to UTF8, but that didn't quite help. Is there anything else I should do?

I'm running Mac OS X 10.8.4, Terminal.app and Oh-My-Zsh

Git Version:

➜  ~  git --version
git version 1.8.2.3
➜  ~  

Edit 1: Locale Output

➜  misterbusinessfinance git:(master) locale 
LANG=
LC_COLLATE="C"
LC_CTYPE="C"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

Edit 2 : Resolution

In my case all I had to do was setting a envvar called LANG. In my ~/.zshrc file I wrote something like:

export LANG="pt_BR.UTF-8"

Or whatever language suits you.


Solution

  • I'm not sure your terminal settings are correct. Here's a screenshot of mine:

    The character encoding is set to "UTF-8", and the checkbox to "Set locale environment variables on startup" is checked. Make sure the settings are correct, and then restart Terminal. You need to make sure you don't just close the window, but quit terminal all together and restart it.

    If it's still not doing the trick, add this into ~/.zshenv:

    export LANG="en_US.UTF-8"
    

    Or whatever variant makes sense for you.