icdiff
icdiff copied to clipboard
Feature Request: auto-detect encodings
I use icdiff with git. It's awesome! But some of my project files are not in utf8 and I can not view diff with that files. Would it be more reliable not to throw exception but to convert bad symbols as escape sequences or stub chars?
$ git diff HEAD~
error: file '/tmp/R97Zaw_http.c' not valid with encoding 'utf-8': <invalid continuation byte> at 74350-74351
I get the same error when I diff two binary file.
The correct way will be to enable encoding auto-detection instead. There are many libraries for that.
At the moment use something like --encoding=ISO8859
for example (use file MYFILE.txt
to check the encoding).
I resolved it with uchardet tool, like this:
icdiff --encoding=$(uchardet $file1) $file1 $file2