8 # cf. http://en.wikipedia.org/wiki/Latin1
9 # http://en.wikipedia.org/wiki/ISO-8859-15
10 ###############################################################################
12 # mime : charset found in Content-Type HTTP MIME header
13 # meta : charset found in Content-Type meta tag
15 # index.html mime + file = iso-8859-15
16 # p1_français.html meta + file = iso-8859-1, mime = utf-8
17 # p2_één.html meta + file = utf-8, mime =iso-8859-1
20 my $ccedilla_l1 = "\xE7";
21 my $ccedilla_u8 = "\xC3\xA7";
22 my $eacute_l1 = "\xE9";
23 my $eacute_u8 = "\xC3\xA9";
26 http://localhost:{{port}}/
27 http://localhost:{{port}}/p1_fran${ccedilla_l1}ais.html
28 http://localhost:{{port}}/p2_${eacute_l1}${eacute_l1}n.html
31 my $pageindex = <<EOF;
34 <title>Main Page</title>
44 my $pagefrancais = <<EOF;
47 <title>La seule page en français</title>
48 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
61 <title>Die enkele nederlandstalige pagina</title>
62 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
85 # code, msg, headers, content
91 "Content-type" => "text/html; charset=ISO-8859-15",
93 content => $pageindex,
99 "Content-type" => "text/plain",
103 '/p1_fran%C3%A7ais.html' => { # UTF-8 encoded
105 msg => "File not found",
107 "Content-type" => "text/html; charset=UTF-8",
111 '/p1_fran%E7ais.html' => {
115 "Content-type" => "text/html; charset=UTF-8",
117 content => $pagefrancais,
119 '/p2_%C3%A9%C3%A9n.html' => { # UTF-8 encoded
123 "Content-type" => "text/html; charset=ISO-8859-1",
127 '/p2_%E9%E9n.html' => {
131 "Content-type" => "text/html; charset=ISO-8859-1",
139 "Content-type" => "text/plain; charset=ISO-8859-1",
145 my $cmdline = $WgetTest::WGETPATH . " --iri -d -i http://localhost:{{port}}/url_list.txt";
147 my $expected_error_code = 0;
149 my %expected_downloaded_files = (
154 content => $pageindex,
156 "p1_fran${ccedilla_l1}ais.html" => {
157 content => $pagefrancais,
159 "p2_${eacute_u8}${eacute_u8}n.html" => {
164 ###############################################################################
166 my $the_test = HTTPTest->new (name => "Test-iri-list",
169 errcode => $expected_error_code,
170 output => \%expected_downloaded_files);
171 exit $the_test->run();