summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2017-01-22 10:55:43 -0700
committerKarl Williamson <khw@cpan.org>2017-01-22 11:03:45 -0700
commit8ff713d9d0097d24f522a287d497b801fedd19ce (patch)
tree34839ba84ff22becb7963646b64d523c16f60326
parent5d4414ef5fb50c1a13cfc41ab798de251e78c07c (diff)
downloadperl-8ff713d9d0097d24f522a287d497b801fedd19ce.tar.gz
lib/utf8.t: Generalize for EBCDIC
This had an ASCII-specific test which has been failing on EBCDIC platforms.
-rw-r--r--lib/utf8.t5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/utf8.t b/lib/utf8.t
index 6b28eae948..e5f9547a8a 100644
--- a/lib/utf8.t
+++ b/lib/utf8.t
@@ -140,6 +140,9 @@ no utf8; # Ironic, no?
= join " . ", map {sprintf 'chr (%d)', ord $_} split //, $char;
push @char, [$_, $char, $charsubst, $char_as_ord];
}
+ my $malformed = $::IS_ASCII
+ ? "\xE1\xA0"
+ : I8_to_native("\xE6\xA0");
# Now we've done all the UTF8 munching hopefully we're safe
my @tests = (
['check our detection program works',
@@ -162,7 +165,7 @@ no utf8; # Ironic, no?
# "out of memory" error. We really need the "" [rather than qq()
# or q()] to get the best explosion.
["!Feed malformed utf8 into perl.", <<"BANG",
- use utf8; %a = ("\xE1\xA0"=>"sterling");
+ use utf8; %a = ("$malformed" =>"sterling");
print 'start'; printf '%x,', ord \$_ foreach keys %a; print "end\n";
BANG
qr/^Malformed UTF-8 character: .*? \(too short; \d bytes? available, need \d\).*start\d+,end$/sm