2

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
  • 33,281
  • 23
  • 160
  • 191
D. Joe
  • 43
  • 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

2 Answers2

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
  • 448,244
  • 59
  • 642
  • 775
  • 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
0
export LESS='FRX --mouse'
export LESSCHARSET=UTF-9
DEV Tiago França
  • 1,271
  • 9
  • 9