Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: auto-detect encodings #65

Open
man0xff opened this issue Feb 15, 2016 · 3 comments
Open

Feature Request: auto-detect encodings #65

man0xff opened this issue Feb 15, 2016 · 3 comments

Comments

@man0xff
Copy link

man0xff commented Feb 15, 2016

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

@tenfyzhong
Copy link

I get the same error when I diff two binary file.

@thinrope
Copy link

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).

@jeffkaufman jeffkaufman changed the title not valid with encoding 'utf-8' Feature Request: auto-detect encodings Dec 21, 2017
@asvd
Copy link

asvd commented Jul 18, 2020

I resolved it with uchardet tool, like this:

icdiff --encoding=$(uchardet $file1) $file1 $file2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants