8 # cf. http://en.wikipedia.org/wiki/Latin1
9 # 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 mime + file = iso-8859-1
19 # p3_€€€.html meta + file = utf-8, mime = iso-8859-1
22 my $ccedilla_l15 = "\xE7";
23 my $ccedilla_u8 = "\xC3\xA7";
24 my $eacute_l1 = "\xE9";
25 my $eacute_u8 = "\xC3\xA9";
26 my $eurosign_l15 = "\xA4";
27 my $eurosign_u8 = "\xE2\x82\xAC";
29 my $pageindex = <<EOF;
32 <title>Main Page</title>
36 Link to page 1 <a href="http://localhost:{{port}}/p1_fran${ccedilla_l15}ais.html">La seule page en français</a>.
37 Link to page 3 <a href="http://localhost:{{port}}/p3_${eurosign_l15}${eurosign_l15}${eurosign_l15}.html">My tailor is rich</a>.
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"/>
51 Link to page 2 <a href="http://localhost:{{port}}/p2_${eacute_l1}${eacute_l1}n.html">Die enkele nerderlangstalige pagina</a>.
60 <title>Die enkele nederlandstalige pagina</title>
64 Één is niet veel maar toch meer dan nul.<br/>
65 Nerdelands is een mooie taal... dit zin stuckje spreekt vanzelf, of niet :)
74 <title>Euro page</title>
78 My tailor isn't rich anymore.
97 # code, msg, headers, content
103 "Content-type" => "text/html; charset=ISO-8859-15",
105 content => $pageindex,
111 "Content-type" => "text/plain",
115 '/p1_fran%C3%A7ais.html' => { # UTF-8 encoded
117 msg => "File not found",
119 "Content-type" => "text/html; charset=UTF-8",
121 content => $pagefrancais,
123 '/p1_fran%E7ais.html' => {
127 "Content-type" => "text/html; charset=UTF-8",
129 content => $pagefrancais,
131 '/p2_%C3%A9%C3%A9n.html' => { # UTF-8 encoded
135 "Content-type" => "text/html; charset=UTF-8",
139 '/p2_%E9%E9n.html' => {
143 "Content-type" => "text/html; charset=ISO-8859-1",
147 '/p3_%E2%82%AC%E2%82%AC%E2%82%AC.html' => { # UTF-8 encoded
151 "Content-type" => "text/plain",
153 content => $pageeuro,
155 '/p3_%A4%A4%A4.html' => {
159 "Content-type" => "text/plain",
161 content => $pageeuro,
165 my $cmdline = $WgetTest::WGETPATH . " --no-iri -nH -r http://localhost:{{port}}/";
167 my $expected_error_code = 0;
169 my %expected_downloaded_files = (
171 content => $pageindex,
176 "p1_fran${ccedilla_l15}ais.html" => {
177 content => $pagefrancais,
179 "p2_${eacute_l1}${eacute_l1}n.html" => {
182 "p3_${eurosign_l15}${eurosign_l15}${eurosign_l15}.html" => {
183 content => $pageeuro,
187 ###############################################################################
189 my $the_test = HTTPTest->new (name => "Test-iri-disabled",
192 errcode => $expected_error_code,
193 output => \%expected_downloaded_files);
194 exit $the_test->run();