pTHX_ / aTHX_ for ExtUtils/Constant.pm
[p5sagit/p5-mst-13.2.git] / t / io / utf8.t
index 52b641d..fee0fe6 100755 (executable)
@@ -9,6 +9,8 @@ BEGIN {
     }
 }
 
+no utf8; # so that the naked 8-bit chars won't gripe under use utf8
+
 $| = 1;
 my $total_tests = 25;
 if (ord('A') == 193) { $total_tests = 24; } # EBCDIC platforms do not warn on UTF-8
@@ -135,8 +137,9 @@ print "ok 21\n";
 
 # Now let's make it suffer.
 open F, ">", "a" or die $!;
-eval { print F $a; };
-print "not " unless $@ and $@ =~ /Wide character in print/i;
+my $w;
+eval {local $SIG{__WARN__} = sub { $w = $_[0] };  print F $a; };
+print "not " if ($@ || $w !~ /Wide character in print/i);
 print "ok 22\n";
 }