diff options
-rw-r--r-- | regcharclass.h | 2 | ||||
-rw-r--r-- | regen/regcharclass_multi_char_folds.pl | 12 |
2 files changed, 10 insertions, 4 deletions
diff --git a/regcharclass.h b/regcharclass.h index 54f3b10db9..f307fd76be 100644 --- a/regcharclass.h +++ b/regcharclass.h @@ -1905,5 +1905,5 @@ * a712c758275b460d18fa77a26ed3589689bb3f69dcc1ea99b913e32db92a5cd2 lib/unicore/version * 2680b9254eb236c5c090f11b149605043e8c8433661b96efc4a42fb4709342a5 regen/charset_translations.pl * 8cffbf838b6e8ea5310e4ad2e0498ad9c1d87d4babead678081859473591317c regen/regcharclass.pl - * 1ff734f7ad2d8d8fbbb2d091e5301da4b175a37fd1cbce553cd228035e98ec72 regen/regcharclass_multi_char_folds.pl + * 2bc7f79dc0257ad12db2288ccfcae7fa07bf0c068e4413b80f32c90d7dde0653 regen/regcharclass_multi_char_folds.pl * ex: set ro: */ diff --git a/regen/regcharclass_multi_char_folds.pl b/regen/regcharclass_multi_char_folds.pl index 9840eb9391..a49dcb333e 100644 --- a/regen/regcharclass_multi_char_folds.pl +++ b/regen/regcharclass_multi_char_folds.pl @@ -45,7 +45,9 @@ sub gen_combinations ($;) { foreach my $j (0 .. @{$fold_ref->[$i]} - 1) { # Append its representation to what we have currently - my $new_string = sprintf "$string\\x{%X}", $fold_ref->[$i][$j]; + my $new_string = $fold_ref->[$i][$j] =~ /[[:print:]]/ + ? ($string . chr $fold_ref->[$i][$j]) + : sprintf "$string\\x{%X}", $fold_ref->[$i][$j]; if ($i >= @$fold_ref - 1) { # Final level: just return it push @ret, "\"$new_string\""; @@ -83,8 +85,12 @@ sub multi_char_folds ($) { die sprintf("regcomp.c can't cope with a latin1 multi-char fold (found in the fold of 0x%X", $cp_ref->[$i]) if grep { $_ < 256 && chr($_) !~ /[[:ascii:]]/ } @{$folds_ref->[$i]}; # Create a line that looks like "\x{foo}\x{bar}\x{baz}" of the code - # points that make up the fold. - my $fold = join "", map { sprintf "\\x{%X}", $_ } @{$folds_ref->[$i]}; + # points that make up the fold (use the actual character if + # printable). + my $fold = join "", map { chr $_ =~ /[[:print:]]/a + ? chr $_ + : sprintf "\\x{%X}", $_ + } @{$folds_ref->[$i]}; $fold = "\"$fold\""; # Skip if something else already has this fold |