Skip to content

Commit 2189077

Browse files
committed
Use foldcase instead of lowercase for case-insensitive P6Regex
When comparing text case-insensitively the correct way is to fold case, instead of just lowercasing the string. Otherwise things like ligatures and other characters who may have special upper and lowercase forms will not be put in an easily comparable format.
1 parent 3d6948a commit 2189077

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/QRegex/P6Regex/Actions.nqp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -735,11 +735,11 @@ class QRegex::P6Regex::Actions is HLL::Actions {
735735
}
736736
elsif $RXim {
737737
my $c := nqp::chr(nqp::ordbaseat(~$_[0], 0));
738-
$str := $str ~ nqp::lc($c) ~ nqp::uc($c);
738+
$str := $str ~ nqp::fc($c) ~ nqp::uc($c);
739739
}
740740
elsif $RXi {
741741
my $c := ~$_[0];
742-
$str := $str ~ nqp::lc($c) ~ nqp::uc($c);
742+
$str := $str ~ nqp::fc($c) ~ nqp::uc($c);
743743
}
744744
elsif $RXm {
745745
$str := $str ~ nqp::chr(nqp::ordbaseat(~$_[0], 0));

0 commit comments

Comments
 (0)