-
Notifications
You must be signed in to change notification settings - Fork 209
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
better diffs when most chars are ASCII #257
Comments
Thanks for the report! At the cost of adding more complexity to the reporter (which I'm fine with, but others seem to not be), the logic can be smarter where it:
I should note that the presence of invalid UTF-8 means that we can't use the triple-quote syntax since the invalid characters would be mangled in possibly indiscernible ways. |
dsnet
added a commit
that referenced
this issue
Apr 30, 2021
The previous heuristic of treating strings as binary data if it contains any invalid UTF-8 was too strict. Loosen the heuristic to check if most of the characters are printable text. Fixes #257
dsnet
added a commit
that referenced
this issue
May 25, 2021
The previous heuristic of treating strings as binary data if it contains any invalid UTF-8 was too strict. Loosen the heuristic to check if most of the characters are printable text. Fixes #257
dsnet
added a commit
that referenced
this issue
May 25, 2021
The previous heuristic of treating strings as binary data if it contains any invalid UTF-8 was too strict. Loosen the heuristic to check if most of the characters are printable text. Fixes #257
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's a recent example diff from an actual test failure:
There are a very few
0xff
bytes in there which are causing the whole thing to be rendered as a binary diff,which is quite a bit harder to read.
Maybe there's a way of formatting diffs somehow that treats the non-ASCII bytes as exceptions rather than the rule.
The text was updated successfully, but these errors were encountered: