sv_catpvs(varsv, "::");
/* Ensure SvSETMAGIC() is called if necessary. In particular, to clear
tainting if $FOO::AUTOLOAD was previously tainted, but is not now. */
- sv_catpvn_mg(varsv, name, len);
+ sv_catpvn_flags(
+ varsv, name, len,
+ SV_GMAGIC|SV_SMAGIC|(is_utf8 ? SV_CATUTF8 : SV_CATBYTES)
+ );
if (is_utf8)
SvUTF8_on(varsv);
return gv;
use open qw( :utf8 :std );
no warnings 'once';
-plan(tests => 61);
+plan(tests => 62);
#Can't use bless yet, as it might not be clean
ok(ฟọ::バッズ->nèw, 'Also works with UTF-8 methods');
ok(ฟọ::バッズ->ニュー, 'Even methods from an UTF-8 parent');
+BEGIN {no strict 'refs'; ++${"\xff::foo"} } # autovivify the package
+package ÿ { # without UTF8
+ sub AUTOLOAD {
+ ::is our $AUTOLOAD,
+ "\xff::\x{100}", '$AUTOLOAD made from Latin1 package + UTF8 sub';
+ }
+}
+ÿ->${\"\x{100}"};
+
#This test should go somewhere else.
#DATA was being generated in the wrong package.
package ʑ;