Make git diff show UTF8 encoded characters properly

后端 未结 3 1314
轻奢々
轻奢々 2020-11-30 02:25

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

3条回答
  •  生来不讨喜
    2020-11-30 02:49

    @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

提交回复
热议问题