diff options
author | Karl Williamson <khw@cpan.org> | 2014-11-14 11:18:57 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2014-11-20 21:45:18 -0700 |
commit | ad2de1b2b22db677f46346aac18927b2032d7a68 (patch) | |
tree | b1cc07a52e57c44db48737ac6b646fdf30906b5f /toke.c | |
parent | 47e13f24847018e7947377141de64798abfa1ce9 (diff) | |
download | perl-ad2de1b2b22db677f46346aac18927b2032d7a68.tar.gz |
Make a function to get PL_encoding's value
This is in preparation for making the retrieval more complex in future
commits than it is now. This is going into mg.c because the value is
magical.
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -3589,7 +3589,7 @@ S_scan_const(pTHX_ char *start) SvPOK_on(sv); if (IN_ENCODING && !has_utf8) { - sv_recode_to_utf8(sv, PL_encoding); + sv_recode_to_utf8(sv, _get_encoding()); if (SvUTF8(sv)) has_utf8 = TRUE; } @@ -6926,7 +6926,7 @@ Perl_yylex(pTHX) ENTER; SAVETMPS; PUSHMARK(sp); - XPUSHs(PL_encoding); + XPUSHs(_get_encoding()); PUTBACK; call_method("name", G_SCALAR); SPAGAIN; @@ -9335,7 +9335,7 @@ S_scan_heredoc(pTHX_ char *s) if (UTF && is_utf8_string((U8*)SvPVX_const(tmpstr), SvCUR(tmpstr))) SvUTF8_on(tmpstr); else if (IN_ENCODING) - sv_recode_to_utf8(tmpstr, PL_encoding); + sv_recode_to_utf8(tmpstr, _get_encoding()); } PL_lex_stuff = tmpstr; pl_yylval.ival = op_type; @@ -9630,7 +9630,7 @@ S_scan_str(pTHX_ char *start, int keep_bracketed_quoted, int keep_delims, int re while (cont) { int offset = s - SvPVX_const(PL_linestr); - const bool found = sv_cat_decode(sv, PL_encoding, PL_linestr, + const bool found = sv_cat_decode(sv, _get_encoding(), PL_linestr, &offset, (char*)termstr, termlen); const char *ns; char *svlast; @@ -10520,7 +10520,7 @@ S_scan_formline(pTHX_ char *s) if (UTF && is_utf8_string((U8*)SvPVX_const(stuff), SvCUR(stuff))) SvUTF8_on(stuff); else if (IN_ENCODING) - sv_recode_to_utf8(stuff, PL_encoding); + sv_recode_to_utf8(stuff, _get_encoding()); } NEXTVAL_NEXTTOKE.opval = (OP*)newSVOP(OP_CONST, 0, stuff); force_next(THING); |