simonw / csv-diff

Python CLI tool and library for diffing CSV and JSON files
Apache License 2.0
292 stars 47 forks source link

fix comparing of csv files with non-default file encoding #19

Open mikecoop83 opened 3 years ago

mikecoop83 commented 3 years ago

When using the CLI to compare two CSVs that were encoded using cp1252 on a platform with a default encoding of utf-8, it fails. Since the encoding is not specified when opening the files, the default encoding is used and fails for any byte sequences that are not valid utf-8. This looks like it would resolve #14. The fix in this PR is to allow the user to specify the encoding of the file as a command line option.

mikecoop83 commented 3 years ago

@simonw - any thoughts on this?

danasmoot commented 8 months ago

I would really like to have this feature merged in. The text Im comparing isnt always utf-8.