Revert "[perl #91834] utf8::decode does not respect copy-on-write"
authorFather Chrysostomos <sprout@cpan.org>
Mon, 30 May 2011 03:36:05 +0000 (20:36 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Mon, 30 May 2011 03:39:51 +0000 (20:39 -0700)
This reverts commit 40f11004fb3b5fa1cd207a20090df837d721b736.

lib/utf8.t
universal.c

index b13bb53..ae81ccd 100644 (file)
@@ -427,18 +427,6 @@ SKIP: {
 }
 
 {
-    # Make sure utf8::decode respects copy-on-write [perl #91834].
-    # Hash keys are the easiest way to test this.
-    my $name = "\x{c3}\x{b3}";
-    my ($k1) = keys %{ { $name=>undef } };
-    my $k2 = $name;
-    utf8::decode($k1);
-    utf8::decode($k2);
-    my $h = { $k1 => 1, $k2 => 2 };
-    is join('', keys $h), $k2, 'utf8::decode respects copy-on-write';
-}
-
-{
     my $a = "456\xb6";
     utf8::upgrade($a);
 
index d012c0f..145d860 100644 (file)
@@ -695,7 +695,6 @@ XS(XS_utf8_decode)
        croak_xs_usage(cv, "sv");
     else {
        SV * const sv = ST(0);
-       if (SvIsCOW(sv)) sv_force_normal(sv);
        const bool RETVAL = sv_utf8_decode(sv);
        ST(0) = boolSV(RETVAL);
        sv_2mortal(ST(0));