summaryrefslogtreecommitdiff
path: root/t/io/utf8.t
diff options
context:
space:
mode:
Diffstat (limited to 't/io/utf8.t')
-rwxr-xr-xt/io/utf8.t13
1 files changed, 9 insertions, 4 deletions
diff --git a/t/io/utf8.t b/t/io/utf8.t
index 7b2d6723fc..721d7dbd1f 100755
--- a/t/io/utf8.t
+++ b/t/io/utf8.t
@@ -321,17 +321,22 @@ ok( 1 );
local $SIG{__WARN__} = sub { $@ = shift };
open F, ">a";
binmode F;
- print F "foo", chr(0xE4), "\n";
- print F "foo", chr(0xF6), "\n";
+ my ($chrE4, $chrF6) = (chr(0xE4), chr(0xF6));
+ if (ord('A') == 193) # EBCDIC
+ { ($chrE4, $chrF6) = (chr(0x43), chr(0xEC)); }
+ print F "foo", $chrE4, "\n";
+ print F "foo", $chrF6, "\n";
close F;
open F, "<:utf8", "a";
undef $@;
my $line = <F>;
- like( $@, qr/utf8 "\\xE4" does not map to Unicode .+ <F> line 1/,
+ my ($chrE4, $chrF6) = ("E4", "F6");
+ if (ord('A') == 193) { ($chrE4, $chrF6) = ("43", "EC"); } # EBCDIC
+ like( $@, qr/utf8 "\\x$chrE4" does not map to Unicode .+ <F> line 1/,
"<:utf8 readline must warn about bad utf8");
undef $@;
$line .= <F>;
- like( $@, qr/utf8 "\\xF6" does not map to Unicode .+ <F> line 2/,
+ like( $@, qr/utf8 "\\x$chrF6" does not map to Unicode .+ <F> line 2/,
"<:utf8 rcatline must warn about bad utf8");
close F;
}