7 # cf. http://en.wikipedia.org/wiki/Latin1
8 # 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 mime + file = iso-8859-1
18 # p3_€€€.html meta + file = utf-8, mime = iso-8859-1
21 my $ccedilla_l15 = "\xE7";
22 my $ccedilla_u8 = "\xC3\xA7";
23 my $eacute_l1 = "\xE9";
24 my $eacute_u8 = "\xC3\xA9";
25 my $eurosign_l15 = "\xA4";
26 my $eurosign_u8 = "\xE2\x82\xAC";
28 my $pageindex = <<EOF;
31 <title>Main Page</title>
35 Link to page 1 <a href="http://localhost:{{port}}/p1_fran${ccedilla_l15}ais.html">La seule page en français</a>.
36 Link to page 3 <a href="http://localhost:{{port}}/p3_${eurosign_l15}${eurosign_l15}${eurosign_l15}.html">My tailor is rich</a>.
42 my $pagefrancais = <<EOF;
45 <title>La seule page en français</title>
46 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
50 Link to page 2 <a href="http://localhost:{{port}}/p2_${eacute_l1}${eacute_l1}n.html">Die enkele nerderlangstalige pagina</a>.
59 <title>Die enkele nederlandstalige pagina</title>
63 Één is niet veel maar toch meer dan nul.<br/>
64 Nerdelands is een mooie taal... dit zin stuckje spreekt vanzelf, of niet :)
73 <title>Euro page</title>
77 My tailor isn't rich anymore.
96 # code, msg, headers, content
102 "Content-type" => "text/html; charset=ISO-8859-15",
104 content => $pageindex,
110 "Content-type" => "text/plain",
114 '/p1_fran%C3%A7ais.html' => { # UTF-8 encoded
116 msg => "File not found",
118 "Content-type" => "text/html; charset=UTF-8",
120 content => $pagefrancais,
122 '/p1_fran%E7ais.html' => {
126 "Content-type" => "text/html; charset=UTF-8",
128 content => $pagefrancais,
130 '/p2_%C3%A9%C3%A9n.html' => { # UTF-8 encoded
134 "Content-type" => "text/html; charset=UTF-8",
138 '/p2_%E9%E9n.html' => {
142 "Content-type" => "text/html; charset=ISO-8859-1",
146 '/p3_%E2%82%AC%E2%82%AC%E2%82%AC.html' => { # UTF-8 encoded
150 "Content-type" => "text/plain",
152 content => $pageeuro,
154 '/p3_%A4%A4%A4.html' => {
158 "Content-type" => "text/plain",
160 content => $pageeuro,
164 my $cmdline = $WgetTest::WGETPATH . " --iri=no -nH -r http://localhost:{{port}}/";
166 my $expected_error_code = 0;
168 my %expected_downloaded_files = (
170 content => $pageindex,
175 "p1_fran${ccedilla_l15}ais.html" => {
176 content => $pagefrancais,
178 "p2_${eacute_l1}${eacute_l1}n.html" => {
181 "p3_${eurosign_l15}${eurosign_l15}${eurosign_l15}.html" => {
182 content => $pageeuro,
186 ###############################################################################
188 my $the_test = HTTPTest->new (name => "Test-iri-disabled",
191 errcode => $expected_error_code,
192 output => \%expected_downloaded_files);
193 exit $the_test->run();