Previously the first letter for latin-1 classnames was being mischecked, only
allowing ASCII, which caused an instance of the Unicode Bug for downgradable
classnames.
if (!packname ||
((UTF8_IS_START(*packname) && DO_UTF8(sv))
? !isIDFIRST_utf8((U8*)packname)
- : !isIDFIRST(*packname)
+ : !isIDFIRST_L1((U8)*packname)
))
{
Perl_croak(aTHX_ "Can't call method \"%"SVf"\" %s",
require './test.pl';
}
-plan (tests => 16);
+plan (tests => 18);
use utf8;
use open qw( :utf8 :std );
eval q[package ᕘ {];
like $@, qr/\AMissing right curly /, "comp/package_block.t test";
}
+
+# perl #105922
+
+{
+ my $latin_1 = "þackage";
+ my $utf8 = "þackage";
+ utf8::downgrade($latin_1);
+ utf8::upgrade($utf8);
+
+ local $@;
+ eval { $latin_1->can("yadda") };
+ ok(!$@, "latin1->meth works");
+
+ local $@;
+ eval { $utf8->can("yadda") };
+ ok(!$@, "utf8->meth works");
+}