Re: [pcre-dev] First slot of the offset vector have a wrong …

Pàgina inicial
Delete this message
Autor: Philip Hazel
Data:  
A: pcre-dev
Assumpte: Re: [pcre-dev] First slot of the offset vector have a wrong value when PCRE_ERROR_SHORTUTF8 rises
On Sat, 5 Feb 2011, I wrote:

> I treated PCRE_ERROR_SHORTUTF8 as an error, so the offsets are not set.
>
> > Review this fragment of PCRE code please.
>
> I will do so, but not for some time because I am currently working on
> other things.


... but as I walked down the road just after posting that, I realized
that I cannot make pcre_exec() do what you want. PCRE_ERROR_SHORTUTF8 is
given instead of PCRE_ERROR_BADUTF8, and both are generated during the
check for UTF-8 validity that occurs right at the start of pcre_exec(),
before it does any actual matching. Therefore, it does not have any
starting match value to put in the offsets.

Philip

--
Philip Hazel