Skip to content

fix(patch): on non-UTF8 filename, error rather than panic #65

Open
weihanglo wants to merge 8 commits intobmwill:masterfrom
weihanglo:patchopts
Open

fix(patch): on non-UTF8 filename, error rather than panic #65
weihanglo wants to merge 8 commits intobmwill:masterfrom
weihanglo:patchopts

Conversation

@weihanglo
Copy link
Copy Markdown
Contributor

This is unfortunate we doesn't support non-UTF8 filename with Patch<'_, str> type (pre-existing btw).

This is a spin-off of refactors in #59, and addresses

Octal escape \377 decodes to 0xFF, which is not valid UTF-8.
When parsing into `Patch<'_, str>`,
`convert_cow_to_str` panics via `unwrap()`
instead of returning a parse error.

See bmwill#59 (comment)
This is unfortunate we doesn't support non-UTF8 filename
with `Patch<'_, str>` type (pre-existing btw).
`Text::owned_from_bytes` conversion is needed
when escape sequences are decoded.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant