File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 11package ManifypodsWithUtf8 ;
22use strict;
3+ use utf8;
34use Test::More;
45
56use lib ' t/lib' ;
@@ -21,13 +22,18 @@ my $tmp = MBTest->tmpdir;
2122
2223use DistGen;
2324my $dist = DistGen-> new( dir => $tmp );
24- $dist -> add_file( ' lib/Simple/PodWithUtf8.pod' , <<'---' );
25+ my $content = <<'---' ;
26+
27+ =encoding utf8
28+
2529=head1 NAME
2630
2731Simple::PodWithUtf8 - POD with some (ç á à ô) special chars
2832
2933=cut
3034---
35+ utf8::encode($content );
36+ $dist -> add_file( ' lib/Simple/PodWithUtf8.pod' , $content );
3137$dist -> regen;
3238$dist -> chdir_in;
3339
@@ -49,9 +55,9 @@ my $sep = $mb->manpage_separator;
4955my $ext3 = $mb -> config(' man3ext' );
5056my $to = File::Spec-> catfile(' blib' , ' libdoc' , " Simple${sep} PodWithUtf8.${ext3} " );
5157
52- open my $pod , ' <:utf8 ' , $to ;
53- undef $/ ; my $pod_content = <$pod >;
58+ open my $pod , ' <:encoding(utf-8) ' , $to ;
59+ my $pod_content = do { local $/ ; <$pod > } ;
5460close $pod ;
5561
56- ok $pod_content =~ qr / \( ç á à ô\) / , " POD should contain special characters" ;
62+ like( $pod_content , qr / \( ç á à ô\) / , " POD should contain special characters" ) ;
5763
You can’t perform that action at this time.
0 commit comments