Intelligent encoding detection #4
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We currently try to parse using popular encoding formats (
"utf-8", "utf-8-sig", "cp1252", "latin-1"
). This is very limiting since diffchunk is designed to be a foundational tool. Current design constrains us to a limited set of encoding for files. Leading to bugs such as #1This change uses https://github.com/chardet/chardet to smartly detect the encoding for a versatile parser. We only care about the text anyway, so we should offload that compute to a tool better suited.
This actually resolves #1