Fix some multi-char /i fold bugs
authorKarl Williamson <public@khwilliamson.com>
Thu, 12 May 2011 03:39:19 +0000 (21:39 -0600)
committerKarl Williamson <public@khwilliamson.com>
Thu, 19 May 2011 18:07:08 +0000 (12:07 -0600)
commit5662e3343c9da4c77d4fc27b74174ff698a112c5
treedf12476e1a8dfa5c9f5fe07c2dbbb99723ad5ddc
parent4d5702a21c6c7b7549bde6467c6587df73369009
Fix some multi-char /i fold bugs

Consider U+FB05 and U+FB06.  These both fold to 'st', and hence should
match each other under /i.  However, Unicode doesn't furnish a rule for
this, and Perl hasn't been smart enought to figure it out.  The bug that
shows up is in constructs like

    "\x{fb06}" =~ /[^\x{fb05}]/i

succeeding.  Most of these instances also have a 'S' entry in Unicode's
CaseFolding.txt, which avoids the problem (as mktables was earlier
changed to include those in the generated table).  But there were
several code points that didn't.

This patch changes utf8.c to look for these when constructing it's
inverted list of case fold equivalents.  An alternative would have been
to change mktables instead to look for them and create synthetic rules.
But, this is more general in case the function ends up being used for
other things.

I will change fold_grind.t to test for these in a separate commit.
utf8.c