2

I'm trying to generate diff from file with encoding "UTF-8 Unicode". This is C source code but contains Asians characters(in comments). I've added only few lines but the diff shows several others due to encoding. When I use difftool with kdiff3 it works correctly.

After some investigation I realize that the temporary file, created by diff, has other encoding iso-8859-1.

Can you give me some advise how to overcome this?

best regards Pawel

Austin Mullins
  • 7,307
  • 2
  • 33
  • 48
Pawel Faron
  • 312
  • 2
  • 9
  • Check this out: http://stackoverflow.com/questions/19435071/make-git-diff-show-utf8-encoded-characters-properly – ionutioio Mar 30 '15 at 14:35
  • `ISO-8859-1` and most of the other [one-byte character encodings](https://en.wikipedia.org/wiki/Character_encoding) do not have a signature and there is no way to auto-detect them. The program that reads such a file usually uses a default (configured) encoding to interpret the bytes to as characters. Even for `UTF-8` the program needs to get a hint in order to not mistake it for `ISO-8859-1` or other encoding. – axiac Mar 30 '15 at 14:41
  • So far I've tried several method from the mentioned thread and none works for me. I just need to generate a patch file with only my changes. – Pawel Faron Mar 31 '15 at 07:19

0 Answers0