6 use WgetFeature qw(iri);
9 # " Kon'nichiwa <dot> Japan
10 my $utf8_hostname = "\344\273\212\346\227\245\343\201\257.\346\227\245\346\234\254";
11 my $punycoded_hostname = 'xn--v9ju72g90p.xn--wgv71a';
13 ###############################################################################
15 my $starter_file = <<EOF;
16 <a href="http://$utf8_hostname/foo.txt">The link</a>
19 my $result_file = <<EOF;
23 # code, msg, headers, content
25 "http://$punycoded_hostname/index.html" => {
29 'Content-Type' => 'text/html; charset=UTF-8',
31 content => $starter_file,
33 "http://$punycoded_hostname/foo.txt" => {
37 'Content-Type' => 'text/plain',
39 content => $result_file,
41 "http://$punycoded_hostname/robots.txt" => {
45 'Content-Type' => 'text/plain',
51 my $cmdline = $WgetTest::WGETPATH . " --iri -r"
52 . " -e http_proxy=localhost:{{port}} --local-encoding=UTF-8"
53 . " http://$utf8_hostname/";
55 my $expected_error_code = 0;
57 my %expected_downloaded_files = (
58 "$punycoded_hostname/index.html" => {
59 content => $starter_file,
61 "$punycoded_hostname/foo.txt" => {
62 content => $result_file,
64 "$punycoded_hostname/robots.txt" => {
69 ###############################################################################
71 my $the_test = HTTPTest->new (name => "Test-idn-robots-utf8",
74 errcode => $expected_error_code,
75 output => \%expected_downloaded_files);
76 exit $the_test->run();