summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--t/lib/warnings/toke20
-rw-r--r--toke.c8
2 files changed, 25 insertions, 3 deletions
diff --git a/t/lib/warnings/toke b/t/lib/warnings/toke
index 4c6c8fe6a2..2214005260 100644
--- a/t/lib/warnings/toke
+++ b/t/lib/warnings/toke
@@ -237,6 +237,26 @@ EXPECT
You need to quote "fred" at - line 3.
########
# toke.c
+use utf8;
+use open qw( :utf8 :std );
+use warnings 'syntax' ;
+sub frèd {} ; $SIG{TERM} = frèd;
+no warnings 'syntax' ;
+$SIG{TERM} = frèd;
+EXPECT
+You need to quote "frèd" at - line 5.
+########
+# toke.c
+use utf8;
+use open qw( :utf8 :std );
+use warnings 'syntax' ;
+sub ふれど {} ; $SIG{TERM} = ふれど;
+no warnings 'syntax' ;
+$SIG{TERM} = ふれど;
+EXPECT
+You need to quote "ふれど" at - line 5.
+########
+# toke.c
use warnings 'syntax' ;
@a[3] = 2;
@a{3} = 2;
diff --git a/toke.c b/toke.c
index c0a5cdaf09..426eb2ca23 100644
--- a/toke.c
+++ b/toke.c
@@ -6184,10 +6184,12 @@ Perl_yylex(pTHX)
&len);
while (isSPACE(*t))
t++;
- if (*t == ';' && get_cvn_flags(tmpbuf, len, 0))
+ if (*t == ';'
+ && get_cvn_flags(tmpbuf, len, UTF ? SVf_UTF8 : 0))
Perl_warner(aTHX_ packWARN(WARN_SYNTAX),
- "You need to quote \"%s\"",
- tmpbuf);
+ "You need to quote \"%"SVf"\"",
+ SVfARG(newSVpvn_flags(tmpbuf, len,
+ SVs_TEMP | (UTF ? SVf_UTF8 : 0))));
}
}
}