@INC = '../lib';
require './test.pl';
- plan(tests => 97);
+ plan(tests => 99);
}
use strict;
}
{
+ local $/; # Slurp.
+ my $utf8 = <DATA>;
+ my $utfebcdic = <DATA>;
+ if (ord('A') == 65) {
+ eval $utf8;
+ } elsif (ord('A') == 193) {
+ eval $utfebcdic;
+ }
+}
+__END__
+{
# See if utf8 barewords work [perl #22969]
use utf8;
my %hash = (тест => 123);
is($hash{тест}, $hash{'тест'});
is($hash{тест}, 123);
is($hash{'тест'}, 123);
+
+ # See if plain ASCII strings quoted with '=>' erroneously get utf8 flag [perl #68812]
+ my %foo = (a => 'b', 'c' => 'd');
+ for my $key (keys %foo) {
+ ok !utf8::is_utf8($key), "'$key' shouldn't have utf8 flag";
+ }
+}
+__END__
+{
+ # See if utf8 barewords work [perl #22969]
+ use utf8; # UTF-EBCDIC, really.
+ my %hash = (½ää½âÀ½äâ½ää => 123);
+ is($hash{½ää½âÀ½äâ½ää}, $hash{'½ää½âÀ½äâ½ää'});
+ is($hash{½ää½âÀ½äâ½ää}, 123);
+ is($hash{'½ää½âÀ½äâ½ää'}, 123);
+ %hash = (½ää½âÀ½äâ½ää => 123);
+ is($hash{½ää½âÀ½äâ½ää}, $hash{'½ää½âÀ½äâ½ää'});
+ is($hash{½ää½âÀ½äâ½ää}, 123);
+ is($hash{'½ää½âÀ½äâ½ää'}, 123);
+
+ # See if plain ASCII strings quoted with '=>' erroneously get utf8 flag [perl #68812]
+ my %foo = (a => 'b', 'c' => 'd');
+ for my $key (keys %foo) {
+ ok !utf8::is_utf8($key), "'$key' shouldn't have utf8 flag";
+ }
}