This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regexec.c: utf8 doesn't match /i nonutf8 self
authorKarl Williamson <public@khwilliamson.com>
Wed, 20 Oct 2010 17:11:13 +0000 (11:11 -0600)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 21 Oct 2010 12:57:02 +0000 (05:57 -0700)
commitd4e0b827d7de0f9f86fa8b9dde76e6d722b0cf2d
treeab9699f072b734caeb0f550504c993fd44c2032a
parent4f6b8b29fbb57c889135db458867f054f12476eb
regexec.c: utf8 doesn't match /i nonutf8 self

This is a continuation of [perl #78464].  It fixes it also for the /i
flag.  After this, a character should match itself in the regrepeat
function, even if one is in utf8 and the other isn't, for both /i and
not.

The solution is to move the code for handling /i into the non-i
structure so that the decisions about utf8 are all in one place.  When
the string is in utf8, it uses the utf8-fold function.

This has the added effect of fixing a few cases where a utf8 string did
not match a fold in a non-utf8 pattern.  I haven't added tests for
these, as it only fixes a few cases where this is a problem, and I'm
working on a comprehensive solution to the problem, accompanied by
extensive tests.
regexec.c
t/re/pat.t