summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-10-31 00:57:42 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-10-31 00:57:42 +0000
commit9f4817dbf9f375fea5253c12557f39e3774b891c (patch)
tree5571dace6798f9f2ca01ccd6abbe009034758ad3 /toke.c
parent177cde4c6a7c3c42786feaab44e78d637bb4cb97 (diff)
downloadperl-9f4817dbf9f375fea5253c12557f39e3774b891c.tar.gz
Enable -Mencoding=foobar also for string literals.
p4raw-id: //depot/perl@12782
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/toke.c b/toke.c
index e6d7abc372..90f8305b6c 100644
--- a/toke.c
+++ b/toke.c
@@ -1653,6 +1653,10 @@ S_scan_const(pTHX_ char *start)
Perl_croak(aTHX_ "panic: constant overflowed allocated space");
SvPOK_on(sv);
+ if (PL_encoding && !has_utf8) {
+ Perl_sv_recode_to_utf8(aTHX_ sv);
+ has_utf8 = TRUE;
+ }
if (has_utf8) {
SvUTF8_on(sv);
if (PL_lex_inwhat == OP_TRANS && PL_sublex_info.sub_op) {
@@ -7734,3 +7738,4 @@ utf16rev_textfilter(pTHX_ int idx, SV *sv, int maxlen)
return count;
}
#endif
+