develooper Front page | perl.perl5.porters | Postings from November 2010

Re: The Unicode bug affects ASCII too

Thread Previous | Thread Next
From:
Abigail
Date:
November 30, 2010 06:00
Subject:
Re: The Unicode bug affects ASCII too
Message ID:
20101130140138.GD10708@almanda
On Thu, Aug 12, 2010 at 10:36:47AM -0600, karl williamson wrote:
> I hadn't realized this, even though it was in the output of a program  
> that Tom sent me a long time ago.
>
> An example is that an underscore matches [[:^alnum:]] iff it is in a  
> utf8 string.


I cannot reproduce that. That is, for me, "_" matches [[:^alnum:]] always
(as it should):


    $ perl -wE '$_ = "_"; say /[[:^alnum:]]/'
    1
    $ perl -wE '$_ = "_"; utf8::upgrade $_; say /[[:^alnum:]]/'
    1
    $ perl -wE '$_ = "_"; utf8::downgrade $_; say /[[:^alnum:]]/'
    1
    $

(Same output in both 5.10.0 and 5.12.2)


Since an underscore is neither alphabetical, nor numeric, I do not expect
it to match /[[:alnum:]]/.



Abigail

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