t/uni/latin2.t See if Unicode in latin2 works
t/uni/lex_utf8.t See if Unicode in lexer works
t/uni/lower.t See if Unicode casing works
+t/uni/method.t See if Unicode methods work
t/uni/overload.t See if Unicode overloading works
t/uni/parser.t See if Unicode in the parser works in edge cases.
t/uni/sprintf.t See if Unicode sprintf works
if (!(strchr(method, ':') || strchr(method, '\''))) {
OP *cmop;
if (!SvREADONLY(sv) || !SvFAKE(sv)) {
- sv = newSVpvn_share(method, SvCUR(sv), 0);
+ sv = newSVpvn_share(method, SvUTF8(sv) ? -SvCUR(sv) : SvCUR(sv), 0);
}
else {
kSVOP->op_sv = NULL;
--- /dev/null
+#!./perl -w
+
+#
+# test method calls and autoloading.
+#
+
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = qw(. ../lib);
+ require "test.pl";
+}
+
+use strict;
+use utf8;
+use open qw( :utf8 :std );
+no warnings 'once';
+
+plan(tests => 15);
+
+#Can't use bless yet, as it might not be clean
+
+sub F::b { ::is shift, "F"; "UTF8 meth" }
+sub F::b { ::is shift, "F"; "UTF8 Stash" }
+sub F::b { ::is shift, "F"; "UTF8 Stash&meth" }
+
+is(F->b, "UTF8 meth", "If the method is in UTF-8, lookup works through explicitly named methods");
+is(F->${\"b"}, "UTF8 meth", '..as does for ->${\""}');
+eval { F->${\"b\0nul"} };
+ok $@, "If the method is in UTF-8, lookup is nul-clean";
+
+is(F->b, "UTF8 Stash", "If the stash is in UTF-8, lookup works through explicitly named methods");
+is(F->${\"b"}, "UTF8 Stash", '..as does for ->${\""}');
+eval { F->${\"b\0nul"} };
+ok $@, "If the stash is in UTF-8, lookup is nul-clean";
+
+is(F->b, "UTF8 Stash&meth", "If both stash and method are in UTF-8, lookup works through explicitly named methods");
+is(F->${\"b"}, "UTF8 Stash&meth", '..as does for ->${\""}');
+eval { F->${\"b\0nul"} };
+ok $@, "Even if both stash and method are in UTF-8, lookup is nul-clean";
+