diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-09-29 04:57:42 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-09-29 04:57:42 +0000 |
commit | d9efae67d76cc4acd8980b711b5bebc7142b5319 (patch) | |
tree | 85511ac1926809c78e0399fa9cde4033552336cb /lib/utf8_heavy.pl | |
parent | e8c9ad1b2aea45573ad656f23dcb17204fe59851 (diff) | |
download | perl-d9efae67d76cc4acd8980b711b5bebc7142b5319.tar.gz |
Allow for more flexibility in the \p{In...} names, now
case doesn't matter, and any space or dash can be
matched by any space, dash, underbar, or empty.
(may be going too far on leniency)
p4raw-id: //depot/perl@12264
Diffstat (limited to 'lib/utf8_heavy.pl')
-rw-r--r-- | lib/utf8_heavy.pl | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/utf8_heavy.pl b/lib/utf8_heavy.pl index a90e24ce71..e8cf0cc4ab 100644 --- a/lib/utf8_heavy.pl +++ b/lib/utf8_heavy.pl @@ -26,11 +26,20 @@ sub SWASHNEW { while (($caller = caller($i)) eq __PACKAGE__) { $i++ } my $encoding = $enc{$caller} || "unicore"; (my $file = $type) =~ s!::!/!g; - if ($file =~ /^In(.+)/) { + if ($file =~ /^In[- ]?(.+)/i) { my $In = $1; defined %utf8::In || do "$encoding/In.pl"; - if (exists $utf8::In{$In}) { - $file = "$encoding/In/$utf8::In{$In}"; + my $prefix = substr(lc($In), 0, 3); + if (exists $utf8::InPat{$prefix}) { + for my $k (keys %{$utf8::InPat{$prefix}}) { + if ($In =~ /^$k$/i) { + $In = $utf8::InPat{$prefix}->{$k}; + if (exists $utf8::In{$In}) { + $file = "$encoding/In/$utf8::In{$In}"; + last; + } + } + } } } else { $file =~ s#^(Is|To)([A-Z].*)#$1/$2#; @@ -43,7 +52,7 @@ sub SWASHNEW { || do "$file.pl" || do "$encoding/$file.pl" || do "$encoding/Is/${type}.pl" - || croak("Can't find $encoding character property \"$type\""); + || croak("Can't find Unicode character property \"$type\""); } $| = 1; |