Make git diff show UTF8 encoded characters properly

后端 未结 3 1313
轻奢々
轻奢々 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 03:09

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

    LESSCHARSET=UTF-8
    

提交回复
热议问题