7 # cf. http://en.wikipedia.org/wiki/Latin1
8 # http://en.wikipedia.org/wiki/ISO-8859-15
9 ###############################################################################
11 # mime : charset found in Content-Type HTTP MIME header
12 # meta : charset found in Content-Type meta tag
14 # index.html mime + file = iso-8859-15
15 # p1_français.html meta + file = iso-8859-1, mime = utf-8
16 # p2_één.html meta + file = utf-8, mime =iso-8859-1
19 my $ccedilla_l1 = "\xE7";
20 my $ccedilla_u8 = "\xC3\xA7";
21 my $eacute_l1 = "\xE9";
22 my $eacute_u8 = "\xC3\xA9";
25 http://localhost:{{port}}/
26 http://localhost:{{port}}/p1_fran${ccedilla_l1}ais.html
27 http://localhost:{{port}}/p2_${eacute_l1}${eacute_l1}n.html
30 my $pageindex = <<EOF;
33 <title>Main Page</title>
43 my $pagefrancais = <<EOF;
46 <title>La seule page en français</title>
47 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
60 <title>Die enkele nederlandstalige pagina</title>
61 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
84 # code, msg, headers, content
90 "Content-type" => "text/html; charset=ISO-8859-15",
92 content => $pageindex,
98 "Content-type" => "text/plain",
102 '/p1_fran%C3%A7ais.html' => { # UTF-8 encoded
104 msg => "File not found",
106 "Content-type" => "text/html; charset=UTF-8",
110 '/p1_fran%E7ais.html' => {
114 "Content-type" => "text/html; charset=UTF-8",
116 content => $pagefrancais,
118 '/p2_%C3%A9%C3%A9n.html' => { # UTF-8 encoded
122 "Content-type" => "text/html; charset=ISO-8859-1",
126 '/p2_%E9%E9n.html' => {
130 "Content-type" => "text/html; charset=ISO-8859-1",
138 "Content-type" => "text/plain; charset=ISO-8859-1",
144 my $cmdline = $WgetTest::WGETPATH . " --iri -d -i http://localhost:{{port}}/url_list.txt";
146 my $expected_error_code = 0;
148 my %expected_downloaded_files = (
153 content => $pageindex,
155 "p1_fran${ccedilla_l1}ais.html" => {
156 content => $pagefrancais,
158 "p2_${eacute_u8}${eacute_u8}n.html" => {
163 ###############################################################################
165 my $the_test = HTTPTest->new (name => "Test-iri-list",
168 errcode => $expected_error_code,
169 output => \%expected_downloaded_files);
170 exit $the_test->run();