develooper Front page | perl.perl5.porters | Postings from January 2011

Re: [perl #80190] Length-caching bug in utf8::decode

Thread Previous
From:
Leon Timmermans
Date:
January 10, 2011 06:21
Subject:
Re: [perl #80190] Length-caching bug in utf8::decode
Message ID:
AANLkTin2VhVp2DzpwoLUGuv162RjUJ2nyAboan4Bv1GG@mail.gmail.com
On Mon, Jan 10, 2011 at 1:54 PM, Tony Cook <tony@develop-help.com> wrote:
> Actually, looking at how this is all implemented, the solution could
> be as simple as:
>
>  SvSETMAGIC(sv);
>
> since Perl_magic_setutf8() clears the saved length and pos cache.
>
> Putting that in XS_utf8_decode() in universal.c would be safest in
> terms of the least side-effects on other code, but may leave other
> code that calls sv_utf8_decode() with the same problem.

Adding a sv_utf8_decode_flags() may mitigate that a little, though we
certainly don't have a lack of *_flags functions.

Leon

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About