-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Currently the `InvalidCharError` error returns a `u8` if an invalid hex character is found. If that invalid character happened to be a `char` that encodes as UTF-8 using more than one byte (i.e. not ASCII) then this means the `u8` returned is not the same as the invalid character in the input string. Add support for invalid hex characters that fall outside of a single ASCII byte. Because there are so many edge cases, this is a best effort. I'm not claiming to have gotten this right for all input strings. We default to just returning the byte. Currently a 4-byte encoded character that falls on an odd position in the hex string is not correctly handled but this patch is definitely an improvement none the less.
- Loading branch information
Showing
3 changed files
with
370 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.