6 use WgetFeature qw(iri);
9 # " Kon'nichiwa <dot> Japan
10 my $euc_jp_hostname = "\272\243\306\374\244\317.\306\374\313\334";
11 my $punycoded_hostname = 'xn--v9ju72g90p.xn--wgv71a';
12 my $escaped_hostname = "%ba%a3%c6%fc%a4%cf.%c6%fc%cb%dc";
14 ###############################################################################
16 my $starter_file = <<EOF;
17 <a href="http://$euc_jp_hostname/foo.txt">The link</a>
18 <a href="http://$punycoded_hostname/foo2.txt">The second link</a>
19 <a href="http://$escaped_hostname/foo3.txt">The third link</a>
22 my $result_file = <<EOF;
26 # code, msg, headers, content
28 "http://$punycoded_hostname/index.html" => {
32 'Content-Type' => 'text/html; charset=EUC-JP',
34 content => $starter_file,
36 "http://$punycoded_hostname/foo.txt" => {
40 'Content-Type' => 'text/plain',
42 content => $result_file,
44 "http://$punycoded_hostname/foo2.txt" => {
48 'Content-Type' => 'text/plain',
50 content => $result_file,
52 "http://$punycoded_hostname/foo3.txt" => {
56 'Content-Type' => 'text/plain',
58 content => $result_file,
60 "http://$punycoded_hostname/robots.txt" => {
64 'Content-Type' => 'text/plain',
70 my $cmdline = $WgetTest::WGETPATH . " --iri -r"
71 . " -e http_proxy=localhost:{{port}} --local-encoding=EUC-JP"
72 . " http://$euc_jp_hostname/";
74 my $expected_error_code = 0;
76 my %expected_downloaded_files = (
77 "$punycoded_hostname/index.html" => {
78 content => $starter_file,
80 "$punycoded_hostname/foo.txt" => {
81 content => $result_file,
83 "$punycoded_hostname/foo2.txt" => {
84 content => $result_file,
86 "$punycoded_hostname/foo3.txt" => {
87 content => $result_file,
89 "$punycoded_hostname/robots.txt" => {
94 ###############################################################################
96 my $the_test = HTTPTest->new (name => "Test-idn-robots",
99 errcode => $expected_error_code,
100 output => \%expected_downloaded_files);
101 exit $the_test->run();