6 use WgetFeature qw(iri);
9 # cf. http://en.wikipedia.org/wiki/Latin1
10 # http://en.wikipedia.org/wiki/ISO-8859-15
11 ###############################################################################
13 # mime : charset found in Content-Type HTTP MIME header
14 # meta : charset found in Content-Type meta tag
16 # index.html mime + file = iso-8859-15
17 # p1_français.html meta + file = iso-8859-1, mime = utf-8
18 # p2_één.html meta + file = utf-8, mime =iso-8859-1
21 my $ccedilla_l1 = "\xE7";
22 my $ccedilla_u8 = "\xC3\xA7";
23 my $eacute_l1 = "\xE9";
24 my $eacute_u8 = "\xC3\xA9";
27 http://localhost:{{port}}/
28 http://localhost:{{port}}/p1_fran${ccedilla_l1}ais.html
29 http://localhost:{{port}}/p2_${eacute_l1}${eacute_l1}n.html
32 my $pageindex = <<EOF;
35 <title>Main Page</title>
45 my $pagefrancais = <<EOF;
48 <title>La seule page en français</title>
49 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
62 <title>Die enkele nederlandstalige pagina</title>
63 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
86 # code, msg, headers, content
92 "Content-type" => "text/html; charset=ISO-8859-15",
94 content => $pageindex,
100 "Content-type" => "text/plain",
104 '/p1_fran%C3%A7ais.html' => { # UTF-8 encoded
106 msg => "File not found",
108 "Content-type" => "text/html; charset=UTF-8",
112 '/p1_fran%E7ais.html' => {
116 "Content-type" => "text/html; charset=UTF-8",
118 content => $pagefrancais,
120 '/p2_%C3%A9%C3%A9n.html' => { # UTF-8 encoded
124 "Content-type" => "text/html; charset=ISO-8859-1",
128 '/p2_%E9%E9n.html' => {
132 "Content-type" => "text/html; charset=ISO-8859-1",
140 "Content-type" => "text/plain; charset=ISO-8859-1",
146 my $cmdline = $WgetTest::WGETPATH . " --iri -d -i http://localhost:{{port}}/url_list.txt";
148 my $expected_error_code = 0;
150 my %expected_downloaded_files = (
155 content => $pageindex,
157 "p1_fran${ccedilla_l1}ais.html" => {
158 content => $pagefrancais,
160 "p2_${eacute_u8}${eacute_u8}n.html" => {
165 ###############################################################################
167 my $the_test = HTTPTest->new (name => "Test-iri-list",
170 errcode => $expected_error_code,
171 output => \%expected_downloaded_files);
172 exit $the_test->run();