Tobbe Tobbe - 1 year ago 307
Git Question

Make git diff show UTF8 encoded characters properly

I have a file with Swedish characters in it (åäö) encoded with UTF8.

If I

the file it displays fine, but if I do
git diff
the special characters are printed, for example, as <F6>.

git diff

- name: 'Magler<F6>d, S<F6>der<E5>sen',

What I wanted to see:

- name: 'Magleröd, Söderåsen',

I found another question related to git and encoding problems: git, msysgit, accents, utf-8, the definitive answers
It says all problems should be fixed in git version 1.7.10. I have version

What can I do to make git diff properly display åäö?

Answer Source

@matt and @twalberg were correct. The file wasn't actually UTF-8 encoded. Trying to figure this out wasn't helped by the fact that my terminal (hterm) can't input åäö properly (but it can display and copy/paste them)...

iconv -f ISO-8859-1 -t UTF-8 in.txt > out_utf-8.txt

solved my issue

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download