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

Re: [perl #85034] tring match position on utf8 upgrade

Thread Previous | Thread Next
From:
demerphq
Date:
February 28, 2011 05:08
Subject:
Re: [perl #85034] tring match position on utf8 upgrade
Message ID:
AANLkTimREgEmsxbGN5_Gt+pJk9svLu1u972VQ0JxBZKR@mail.gmail.com
On 27 February 2011 21:40, Ton Hospel <perlbug-followup@perl.org> wrote:
> # New Ticket Created by  Ton Hospel
> # Please include the string:  [perl #85034]
> # in the subject line of all future correspondence about this issue.
> # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=85034 >
>
>
>
> This is a bug report for perl from perl-bug@ton.iguana.be,
> generated with the help of perlbug 1.39 running under perl 5.10.1.
>
>
> -----------------------------------------------------------------
> [Please describe your issue here]
>
> perl -wle '$_="\xce" x 20; pos($_) = 12; utf8::upgrade($_); print pos $_'
> 6
>
> This is because the PERL_MAGIC_regex_global value is in bytes even if the
> string is internally UTF8. If the string gets upgraded this position ought
> to be recalculated

Or should it be treated as a character count?

Yves

-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

Thread Previous | Thread Next


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