3

I am using git client under macOS Sierra 10.12.3, with iTerm2.

I have source files which contain Chinese Simplified & Chinese Traditional characters. Whenever I do git diff, it shows like below:

enter image description here

In NetBeans IDE's git tool, it manages to show diff in Chinese characters.

enter image description here

I read seems git diff is using less to display. Setting export LESSCHARSET=UTF-8 fails.

What shall I configure to make iTerm show git diff correctly? Thanks!

Shuwn Yuan Tee
  • 5,578
  • 6
  • 28
  • 42
  • 2
    Can you test http://stackoverflow.com/a/41843925/6309 and setting `LC_ALL=C.UTF-8` – VonC Jan 25 '17 at 05:38
  • @VonC Tried your suggestion, still same not fixed :( – Shuwn Yuan Tee Jan 25 '17 at 07:11
  • And with `chcp 65001`? (http://stackoverflow.com/a/41416262/6309), also http://stackoverflow.com/a/38694885/6309 – VonC Jan 25 '17 at 07:18
  • I am running on MacOS not Windows. – Shuwn Yuan Tee Jan 25 '17 at 07:24
  • 1
    Right. http://stackoverflow.com/a/5262053/6309 then? Or http://serverfault.com/a/414763/783 (for `less`, used by Git) – VonC Jan 25 '17 at 07:28
  • Is this a problem both in iTerm2 and the standard Terminal? Do you get correct output from `git --no-pager log`? (On a side note, `less` displays unsupported characters as a hex number in angle brackets (controlled by `LESSBINFMT`), like this: ``, by default, so there is something non-standard somewhere). – danmichaelo May 17 '17 at 11:38

0 Answers0