Remove the "hack" that removes SVt_UTF8 in the UTF16 filter, by fixing t/TEST
Nicholas Clark [Thu, 22 Oct 2009 08:26:58 +0000 (09:26 +0100)]
Given that t/TEST already had code to add -I../lib when testing UTF-8 with
-utf8, do likewise for testing UTF-16 with -utf16.

t/TEST
toke.c

diff --git a/t/TEST b/t/TEST
index 10a0e85..4dee636 100755 (executable)
--- a/t/TEST
+++ b/t/TEST
@@ -246,7 +246,7 @@ sub _scan_test {
        }
     }
 
-    my $utf8 = $::with_utf8 ? "-I$lib -Mutf8" : '';
+    my $utf8 = ($::with_utf8 || $::with_utf16) ? "-I$lib -Mutf8" : '';
 
     my %options = (
        perl => $perl,
diff --git a/toke.c b/toke.c
index 7edccf4..72e3e36 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -12817,10 +12817,6 @@ S_utf16_textfilter(pTHX_ int idx, SV *sv, int maxlen)
        *end = '\0';
     }
     SvCUR_set(utf16_buffer, 0);
-    /* This is to be bug-for-bug faithful with the implementation we've just
-       replaced. Without this, ./TEST -utf16 base/lex.t fails, attempting to
-       load utf8.pm  */
-    SvUTF8_off(sv);
     DEBUG_P({sv_dump(sv);});
     return SvCUR(sv);
 }