I have a file with Swedish characters in it (åäö) encoded with UTF8.
If I cat
the file it displays fine, but if I do git diff
the special c
@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
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