# before the patch, the eval died with an error like:
# "my" variable $strict::VERSION can't be in a package
#
-ok('' eq runperl(prog => <<'CODE'), "change #17928");
- my $code = qq{ my \$\xe3\x83\x95\xe3\x83\xbc = 5; };
+SKIP: {
+ skip("Embedded UTF-8 does not work in EBCDIC", 1) if ord("A") == 193;
+ ok('' eq runperl(prog => <<'CODE'), "change #17928");
+ my $code = qq{ my \$\xe3\x83\x95\xe3\x83\xbc = 5; };
{
use utf8;
eval $code;
print $@ if $@;
}
CODE
+}
{
use utf8;
is("@i", "60 62 58 50 52 48 70 72 68", "utf8 heredoc index and rindex");
}
-{
+SKIP: {
+ skip("Embedded UTF-8 does not work in EBCDIC", 1) if ord("A") == 193;
use utf8;
eval qq{is(q \xc3\xbc test \xc3\xbc, qq\xc2\xb7 test \xc2\xb7,
"utf8 quote delimiters [perl #16823]");};
my @tmpfiles = ();
END { unlink @tmpfiles }
+my $b = pack("C*", unpack("U0C*", pack("U",256)));
+
$r = runperl( switches => [ '-CO', '-w' ],
prog => 'print chr(256)',
stderr => 1 );
-like( $r, qr/^\xC4\x80(?:\r?\n)?$/s, '-CO: no warning on UTF-8 output' );
+like( $r, qr/^$b(?:\r?\n)?$/s, '-CO: no warning on UTF-8 output' );
SKIP: {
if (exists $ENV{PERL_UNICODE} &&
$r = runperl( switches => [ '-CI', '-w' ],
prog => 'print ord(<STDIN>)',
stderr => 1,
- stdin => "\xC4\x80" );
+ stdin => $b );
like( $r, qr/^256(?:\r?\n)?$/s, '-CI: read in UTF-8 input' );
}
$r = runperl( switches => [ '-CE', '-w' ],
prog => 'warn chr(256), qq(\n)',
stderr => 1 );
-like( $r, qr/^\xC4\x80(?:\r?\n)?$/s, '-CE: UTF-8 stderr' );
+like( $r, qr/^$b(?:\r?\n)?$/s, '-CE: UTF-8 stderr' );
$r = runperl( switches => [ '-Co', '-w' ],
prog => 'open(F, q(>out)); print F chr(256); close F',