1

Git diff keeps showing non-UTF8 characters.

Suggestion from Make git diff show UTF8 encoded characters properly, I have tried setting export LESSCHARSET=UTF-8 in my .zshrc but it still does not work.

pkamb
  • 30,595
  • 22
  • 143
  • 179
D. Joe
  • 33
  • 2
  • Can you, please, add content from the picture as text. It will be much more readable and you have more chances to get an answer. – Alex Butenko Jan 25 '18 at 02:42

1 Answers1

2

Those are color-setting codes. Either instruct your less to pass them through (via, e.g., -R as an option or R in the environment LESS setting) or disable colored diffs.

Git defaults to setting LESS="FRX" in the environment if no LESS setting is set yet. To make this fail you must be overriding the default, e.g., by providing your own LESS setting or by using command-line options.

torek
  • 389,216
  • 48
  • 524
  • 664
  • Thank you! I did `git config --global core.pager "less -r"` and it sets `pager = less -r` in `.gitconfig`'s `core` section. – D. Joe Jan 25 '18 at 03:26