From 3c54b17ac754f03829f63c4ed668e555e98f7623 Mon Sep 17 00:00:00 2001 From: Brian Fraser Date: Thu, 22 Mar 2012 17:58:14 -0700 Subject: toke.c: 'No such class %s' cleanup. --- t/uni/parser.t | 11 ++++++++++- toke.c | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/t/uni/parser.t b/t/uni/parser.t index f142edb609..a3e3477d9d 100644 --- a/t/uni/parser.t +++ b/t/uni/parser.t @@ -7,7 +7,7 @@ BEGIN { require './test.pl'; } -plan (tests => 38); +plan (tests => 41); use utf8; use open qw( :utf8 :std ); @@ -108,3 +108,12 @@ is ${"main::\345\225\217"}, undef, "..and using the encoded form doesn't"; is $@, 'Unrecognized character \x{1f42a}; marked by <-- HERE after my $ニ <-- HERE near column 8 at (eval 11) line 1. ', "'Unrecognized character' croak is UTF-8 clean"; } + +{ + use feature 'state'; + for ( qw( my state our ) ) { + local $@; + eval "$_ Foo $x = 1;"; + like $@, qr/No such class Foo/u, "'No such class' warning for $_ is UTF-8 clean"; + } +} \ No newline at end of file diff --git a/toke.c b/toke.c index 6a7e1efe45..2fb0a56a0d 100644 --- a/toke.c +++ b/toke.c @@ -7675,7 +7675,7 @@ Perl_yylex(pTHX) char tmpbuf[1024]; PL_bufptr = s; my_snprintf(tmpbuf, sizeof(tmpbuf), "No such class %.1000s", PL_tokenbuf); - yyerror(tmpbuf); + yyerror_pv(tmpbuf, UTF ? SVf_UTF8 : 0); } #ifdef PERL_MAD if (PL_madskills) { /* just add type to declarator token */ -- cgit v1.2.1