summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2001-03-18 10:57:29 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2001-03-18 10:57:29 +0000
commitbe4731d2ab91c4f6213bf88a0084f6128a0db383 (patch)
treed2857f97759b71f56117a4a839df8cbcb60359a5 /toke.c
parent981d4df72cf68dbf990892ca8fb3fd4c96536a65 (diff)
downloadperl-be4731d2ab91c4f6213bf88a0084f6128a0db383.tar.gz
Fix pragma/utf8.t # 15
- if toke.c is processing a SvUTF8 string then single quoted '...' etc. are SvUTF8 as well. p4raw-id: //depot/perlio@9196
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/toke.c b/toke.c
index b802512486..3652c11809 100644
--- a/toke.c
+++ b/toke.c
@@ -37,7 +37,7 @@ static I32 utf16rev_textfilter(pTHXo_ int idx, SV *sv, int maxlen);
#define XENUMMASK 127
/*#define UTF (SvUTF8(PL_linestr) && !(PL_hints & HINT_BYTE))*/
-#define UTF (PL_hints & HINT_UTF8)
+#define UTF ((PL_linestr && DO_UTF8(PL_linestr)) || PL_hints & HINT_UTF8)
/* In variables name $^X, these are the legal values for X.
* 1999-02-27 mjd-perl-patch@plover.com */
@@ -917,8 +917,11 @@ S_tokeq(pTHX_ SV *sv)
if (s == send)
goto finish;
d = s;
- if ( PL_hints & HINT_NEW_STRING )
+ if ( PL_hints & HINT_NEW_STRING ) {
pv = sv_2mortal(newSVpvn(SvPVX(pv), len));
+ if (SvUTF8(sv))
+ SvUTF8_on(pv);
+ }
while (s < send) {
if (*s == '\\') {
if (s + 1 < send && (s[1] == '\\'))