You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...To make it easy to continue if you're ignoring errors or inserting replacement characters.
This requires an error overhaul as many errors already include a position, and having it in two places would be dumb.
On the other hand, if we return (*Error,usize) the errors Display impl cannot use the usize.
Idea:struct SomeError<E>{err:E, len:usize}
The text was updated successfully, but these errors were encountered:
tormol
changed the title
from_utf{8,16}_slice() should return length on error
from_utf8_slice() should return length on error
Jun 2, 2017
For UTF-16 the next unit might always be (the start of) a valid codepoint.
... unless the error is that the second unit is a leading surrogate, and and the unit after it also is a leading surrogate; then ignoring the second unit would be more correct, but that seems unlikely.
tormol
changed the title
from_utf8_slice() should return length on error
Add functions that suggests where to continue after invalid UTF-8/UTF-8 sequences
Oct 15, 2018
I've decided to only advance one u8/u16 per returned error for predictability, but there could be helper functions that do this.
tormol
changed the title
Add functions that suggests where to continue after invalid UTF-8/UTF-8 sequences
Add functions that suggests where to continue after invalid UTF-8/UTF-16 sequences
Mar 22, 2019
...To make it easy to continue if you're ignoring errors or inserting replacement characters.
This requires an error overhaul as many errors already include a position, and having it in two places would be dumb.
On the other hand, if we return
(*Error,usize)
the errorsDisplay
impl cannot use theusize
.Idea:
struct SomeError<E>{err:E, len:usize}
The text was updated successfully, but these errors were encountered: