Make git diff show UTF8 encoded characters properly Make git diff show UTF8 encoded characters properly git git

Make git diff show UTF8 encoded characters properly


git is dumping out raw bytes. In this case, it doesn't care what your file's encoding is. The highlighted <F6> you're seeing is coming from less, which is presumably configured as your PAGER. Try setting:

LESSCHARSET=UTF-8


@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


git log will be opened by less not vi.

So you should set lang to less.

$ export LESSCHARSET=utf-8 && git log