In perl.git, the branch blead has been updated
<http://perl5.git.perl.org/perl.git/commitdiff/a6f87d8c282ba94b0308898be052d1ac956d0ea9?hp=8a38a8369536df0f4eac69e5a26e9b86f9123d1d>
- Log -----------------------------------------------------------------
commit a6f87d8c282ba94b0308898be052d1ac956d0ea9
Author: Karl Williamson <k...@khw-desktop.(none)>
Date: Fri May 14 08:56:46 2010 -0600
PATCH: user defined special casing for non utf8
Users can define their own case changing mappings to replace the
standard ones. Prior to this patch, any mappings on characters whose
ordinals are 0-222, 224-255 that resulted in multiple characters were
ignored.
Note that there still is a deficiency in that the mappings will be
applied only to strings in utf8 format.
-----------------------------------------------------------------------
Summary of changes:
t/op/lc_user.t | 9 ++++++++-
utf8.c | 3 +--
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/t/op/lc_user.t b/t/op/lc_user.t
index 276e2f2..664cc6c 100644
--- a/t/op/lc_user.t
+++ b/t/op/lc_user.t
@@ -4,7 +4,11 @@ BEGIN {
require './test.pl';
}
-plan tests => 4;
+plan tests => 5;
+
+%utf8::ToSpecUpper = (
+"s" => "SS", # Make sure can handle weird ASCII translations
+);
sub ToUpper {
return <<END;
@@ -14,6 +18,9 @@ END
is("\Ufoo\x{101}", "foo\x{101}", "no changes on 'foo'");
is("\Ubar\x{101}", "BAr\x{101}", "changing 'ab' on 'bar' ");
+my $s = 's';
+utf8::upgrade $s;
+is(uc($s), "SS", "Verify uc('s') is 'SS' with our weird xlation, and utf8");
sub ToLower {
return <<END;
diff --git a/utf8.c b/utf8.c
index 1a6077c..eeea158 100644
--- a/utf8.c
+++ b/utf8.c
@@ -1653,8 +1653,7 @@ Perl_to_utf8_case(pTHX_ const U8 *p, U8* ustrp, STRLEN
*lenp,
}
}*/
- /* The 0xDF is the only special casing Unicode code point below 0x100. */
- if (special && (uv1 == 0xDF || uv1 > 0xFF)) {
+ if (special) {
/* It might be "special" (sometimes, but not always,
* a multicharacter mapping) */
HV * const hv = get_hv(special, 0);
--
Perl5 Master Repository