From 07e3a81e0183912fe453ada4194b4e7a1d3c39ec Mon Sep 17 00:00:00 2001
From: ntrifunovic utf8::next
is faster. The second purpose is to find a beginning
- of a UTF-8 sequence if we have a random position within a string.
+ of a UTF-8 sequence if we have a random position within a string. Note that in that
+ case utf8::prior
may not detect an invalid UTF-8 sequence in some scenarios:
+ for instance if there are superfluous trail octets, it will just skip them.
it
will typically point to the beginning of
@@ -451,10 +453,12 @@ assert (w == twochars);
beginning with that octet is decoded to a 32 bit representation and returned.
- In case pass_end
is reached before a UTF-8 lead octet is hit, or if an
+ In case start
is reached before a UTF-8 lead octet is hit, or if an
invalid UTF-8 sequence is started by the lead octet, an invalid_utf8
exception is thrown.
In case start
equals it
, a not_enough_room
+ exception is thrown.
- In case pass_end
is reached before a UTF-8 lead octet is hit, or if an
+ In case pass_start
is reached before a UTF-8 lead octet is hit, or if an
invalid UTF-8 sequence is started by the lead octet, an invalid_utf8
exception is thrown