Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(parser): catch all illegal UTF-8 bytes (#2415)
Catch all illegal UTF-8 bytes with the `UER` byte handler. From https://datatracker.ietf.org/doc/html/rfc3629: > The octet values C0, C1, F5 to FF never appear. This change *should* make no difference at all, as a valid `&str` may not contain any of these byte values anyway. But it's possible if user has e.g. created the string with `str::from_utf8_unchecked` and not obeyed the safety contraints. This will at least contain the damage if that's happened, and panic rather than lead to UB. And since we're already catching other error conditions, may as well catch them all.
- Loading branch information