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 /mg.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 'mg.c')
-rw-r--r-- | mg.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -767,6 +767,14 @@ S_fixup_errno_string(pTHX_ SV* sv) } } +SV* +Perl__get_encoding(pTHX) +{ + /* Returns the $^ENCODING or 'use encoding' in effect; NULL if none */ + + return PL_encoding; +} + #ifdef VMS #include <descrip.h> #include <starlet.h> @@ -817,7 +825,7 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg) case '\005': /* ^E */ if (nextchar != '\0') { if (strEQ(remaining, "NCODING")) - sv_setsv(sv, PL_encoding); + sv_setsv(sv, _get_encoding()); break; } |