1 #!/usr/local/bin/perl -w
9 plan skip_all => 'Older Perl lacking unicode support' ;
17 my $orig_text = "\x{20ac}\n" ;
18 my $unicode_length = length $orig_text ;
20 my $control_file = "control.$mode" ;
21 my $slurp_file = "slurp.$mode" ;
23 open( my $fh, ">$mode", $control_file ) or
24 die "cannot create control unicode file '$control_file' $!" ;
25 print $fh $orig_text ;
28 my $slurp_utf = read_file( $control_file, binmode => $mode ) ;
29 ok( $slurp_utf eq $orig_text, "read_file of $mode file" ) ;
31 # my $slurp_utf_length = length $slurp_utf ;
32 # my $slurp_text = read_file( $control_file ) ;
33 # my $slurp_text_length = length $slurp_text ;
34 # print "LEN UTF $slurp_utf_length TXT $slurp_text_length\n" ;
36 write_file( $slurp_file, {binmode => $mode}, $orig_text ) ;
38 open( $fh, "<$mode", $slurp_file ) or
39 die "cannot open slurp test file '$slurp_file' $!" ;
40 my $read_length = read( $fh, my $utf_text, $unicode_length ) ;
43 ok( $utf_text eq $orig_text, "write_file of $mode file" ) ;
45 unlink( $control_file, $slurp_file ) ;