Heredocs and use encoding didn't work for SJIS;
authorJarkko Hietaniemi <jhi@iki.fi>
Sat, 5 Apr 2003 19:08:37 +0000 (19:08 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Sat, 5 Apr 2003 19:08:37 +0000 (19:08 +0000)
patch from Inaba Hiroto.

p4raw-id: //depot/perl@19146

toke.c

diff --git a/toke.c b/toke.c
index 1b6baaa..0009d62 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -6688,8 +6688,12 @@ retval:
        Renew(SvPVX(tmpstr), SvLEN(tmpstr), char);
     }
     SvREFCNT_dec(herewas);
-    if (UTF && !IN_BYTES && is_utf8_string((U8*)SvPVX(tmpstr), SvCUR(tmpstr)))
-       SvUTF8_on(tmpstr);
+    if (!IN_BYTES) {
+       if (UTF && is_utf8_string((U8*)SvPVX(tmpstr), SvCUR(tmpstr)))
+           SvUTF8_on(tmpstr);
+       else if (PL_encoding)
+           sv_recode_to_utf8(tmpstr, PL_encoding);
+    }
     PL_lex_stuff = tmpstr;
     yylval.ival = op_type;
     return s;