nayakgi / perl-compiler

Automatically exported from code.google.com/p/perl-compiler
Other
0 stars 0 forks source link

match utf8 regex #338

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

> perlcc -r -e 'use utf8; my $l = 'ñ'; my $re = qr/ñ/; print length($l)."\n"; 
print ord($l)."\n"; print qq{ok\n} if $l =~ $re;'
1
241

What is the expected output?

> perl -e 'use utf8; my $l = 'ñ'; my $re = qr/ñ/; print length($l)."\n"; 
print ord($l)."\n"; print qq{ok\n} if $l =~ $re;'
1
241
ok

Please use labels and text to provide additional information.

Original issue reported on code.google.com by nicolas....@gmail.com on 12 May 2014 at 4:22

GoogleCodeExporter commented 9 years ago

Original comment by reini.urban on 12 May 2014 at 7:32

GoogleCodeExporter commented 9 years ago
Issue 333 has been merged into this issue.

Original comment by reini.urban on 13 May 2014 at 6:20

GoogleCodeExporter commented 9 years ago
Fixed with commit 5b5616d73841ef5ebd86bba710c17310bb682517
Author: Reini Urban <rurban@cpanel.net>
Date:   Mon May 12 16:02:12 2014 -0500

    C 1.45_14: support utf8 qr

    B::PMOP->precomp does not set the utf8 flag, so
    we check for utf8 chars in compiled qr strings by ourselves
    and set the UTF8 flags then.
    Beware that DateTime has % in the $re str, so we cannot sprintf it.

    Fixes issue 333 and issue 338, and was checked with qr tests
    20 39 44 71 131 143 1431 1432 330 333 338

Original comment by reini.urban on 13 May 2014 at 6:20