summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--t/lib/strict/vars9
-rw-r--r--util.c2
2 files changed, 10 insertions, 1 deletions
diff --git a/t/lib/strict/vars b/t/lib/strict/vars
index 568d991978..b8c6d1f6e2 100644
--- a/t/lib/strict/vars
+++ b/t/lib/strict/vars
@@ -554,3 +554,12 @@ package Foo;
use strict;
eval 'package foo; @bar = 1' or die;
EXPECT
+########
+# UTF8 and Latin1 package names equivalent at the byte level
+use utf8;
+# ĵ in UTF-8 is the same as ĵ in Latin-1
+package ĵ;
+*ĵ::bar = [];
+use strict;
+eval 'package ĵ; @bar = 1' or die;
+EXPECT
diff --git a/util.c b/util.c
index 500bef55b3..716944d8f1 100644
--- a/util.c
+++ b/util.c
@@ -5861,7 +5861,7 @@ Perl_stashpv_hvname_match(pTHX_ const COP *c, const HV *hv)
if (!stashpv || !name)
return stashpv == name;
- if ( HvNAMEUTF8(hv) && !utf8 ) {
+ if ( !HvNAMEUTF8(hv) != !utf8 ) {
if (utf8) {
return (bytes_cmp_utf8(
(const U8*)stashpv, len,