3 # text-encoding.t -- Test Pod::Text with various weird encoding combinations.
5 # Copyright 2002, 2004, 2006, 2007, 2008 by Russ Allbery <rra@stanford.edu>
7 # This program is free software; you may redistribute it and/or modify it
8 # under the same terms as Perl itself.
12 if ($ENV{PERL_CORE}) {
15 unshift (@INC, '../blib/lib');
17 unshift (@INC, '../blib/lib');
21 # PerlIO encoding support requires Perl 5.8 or later.
25 print "ok $n # skip -- Perl 5.8 required for UTF-8 support\n";
32 print "not ok 1\n" unless $loaded;
41 eval { binmode (\*DATA, ':raw') };
42 eval { binmode (\*STDOUT, ':raw') };
45 $opts{utf8} = 1 if $n == 4;
46 my $parser = Pod::Text->new (%opts) or die "Cannot create parser\n";
47 next until $_ eq "###\n";
48 open (TMP, '> tmp.pod') or die "Cannot create tmp.pod: $!\n";
49 eval { binmode (\*TMP, ':raw') };
51 last if $_ eq "###\n";
55 open (OUT, '> out.tmp') or die "Cannot create out.tmp: $!\n";
56 eval { binmode (\*OUT, ':raw') };
57 $parser->parse_from_file ('tmp.pod', \*OUT);
59 open (TMP, 'out.tmp') or die "Cannot open out.tmp: $!\n";
60 eval { binmode (\*TMP, ':raw') };
67 unlink ('tmp.pod', 'out.tmp');
70 last if $_ eq "###\n";
73 if ($output eq $expected) {
77 print "Expected\n========\n$expected\nOutput\n======\n$output\n";
82 # Below the marker are bits of POD and corresponding expected text output.
83 # This is used to test specific features or problems with Pod::Text. The
84 # input and output are separated by lines containing only ###.
89 =head1 Test of SE<lt>E<gt>
91 This is S<some whitespace>.
94 This is some whitespace.
101 =head1 I can eat glass
107 Mi povas manÄ
\9di vitron, Ä
\9di ne damaÄ
\9das min.
111 â
\8aâ
\80â
\89â
\81â
\9dâ
\80â
\91â
\81â
\9eâ
\80â
\9bâ
\87â
\81â
\8eâ
\8eâ
\80â
\81â
\9dâ
\99â
\80â
\8aâ
\9eâ
\80â
\99â
\95â
\91â
\8eâ
\9dâ
\9eâ
\80â
\93â ¥â
\97â
\9eâ
\80â
\8dâ
\91
115 मà¥
\88à¤
\82 à¤
\95ाà¤
\81à¤
\9a à¤
\96ा सà¤
\95ता हà¥
\82à¤
\81 à¤
\94र मà¥
\81à¤
\9dà¥
\87 à¤
\89ससà¥
\87 à¤
\95à¥
\8bà¤
\88 à¤
\9aà¥
\8bà¤
\9f नहà¥
\80à¤
\82 पहà¥
\81à¤
\82à¤
\9aतà¥
\80.
119 See L<http://www.columbia.edu/kermit/utf8.html>
123 Mi povas manÄ
\9di vitron, Ä
\9di ne damaÄ
\9das min.
126 â
\8aâ
\80â
\89â
\81â
\9dâ
\80â
\91â
\81â
\9eâ
\80â
\9bâ
\87â
\81â
\8eâ
\8eâ
\80â
\81â
\9dâ
\99â
\80â
\8aâ
\9eâ
127 \80â
\99â
\95â
\91â
\8eâ
\9dâ
\9eâ
\80â
\93â ¥â
\97â
\9eâ
\80â
\8dâ
\91
130 मà¥
\88à¤
\82 à¤
\95ाà¤
\81à¤
\9a à¤
\96ा सà¤
\95ता हà¥
\82à¤
\81 à¤
\94र
131 मà¥
\81à¤
\9dà¥
\87 à¤
\89ससà¥
\87 à¤
\95à¥
\8bà¤
\88 à¤
\9aà¥
\8bà¤
\9f नहà¥
\80à¤
\82
132 पहà¥
\81à¤
\82à¤
\9aतà¥
\80.
134 See <http://www.columbia.edu/kermit/utf8.html>