From: Jarkko Hietaniemi Date: Sat, 5 Apr 2003 19:08:37 +0000 (+0000) Subject: Heredocs and use encoding didn't work for SJIS; X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2f31ce7514c4aa5e63439203b688762243ac5b01;p=p5sagit%2Fp5-mst-13.2.git Heredocs and use encoding didn't work for SJIS; patch from Inaba Hiroto. p4raw-id: //depot/perl@19146 --- diff --git a/toke.c b/toke.c index 1b6baaa..0009d62 100644 --- 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;