From 07e3a81e0183912fe453ada4194b4e7a1d3c39ec Mon Sep 17 00:00:00 2001 From: ntrifunovic Date: Sun, 20 Feb 2011 18:33:36 +0000 Subject: [PATCH] Fix for ID: 3185087 - utf8::prior and utf8::previous documentation issue git-svn-id: http://svn.code.sf.net/p/utfcpp/code@118 a809a056-fc17-0410-9590-b4f493f8b08e --- doc/utf8cpp.html | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/utf8cpp.html b/doc/utf8cpp.html index 3f04ce2..c0a89a2 100644 --- a/doc/utf8cpp.html +++ b/doc/utf8cpp.html @@ -441,7 +441,9 @@ assert (w == twochars); This function has two purposes: one is two iterate backwards through a UTF-8 encoded string. Note that it is usually a better idea to iterate forward instead, since 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.

utf8::previous

@@ -512,7 +516,7 @@ 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 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