/[suikacvs]/test/html-whatpm/parser-manakai.cgi
Suika

Diff of /test/html-whatpm/parser-manakai.cgi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by wakaba, Sun Jul 15 06:14:30 2007 UTC revision 1.5 by wakaba, Sun Jul 15 07:53:00 2007 UTC
# Line 120  if (@mode == 3 and $mode[0] eq 'html' an Line 120  if (@mode == 3 and $mode[0] eq 'html' an
120    }    }
121    print STDOUT Encode::encode ('utf-8', $$out);    print STDOUT Encode::encode ('utf-8', $$out);
122    print STDOUT "\n";    print STDOUT "\n";
123    } elsif (@mode == 3 and $mode[0] eq 'h2h' and $mode[1] eq '' and
124             ($mode[2] eq 'html' or $mode[2] eq 'test')) {
125      print STDOUT "Content-Type: text/plain; charset=utf-8\n\n";
126    
127      require Encode;
128      $time1 = time;
129      $s = Encode::decode ('utf-8', $s);
130      $time2 = time;
131      $time{decode} = $time2 - $time1;
132    
133      require Whatpm::H2H;
134      $doc = $dom->create_document;
135      Whatpm::H2H->parse_string ($s => $doc);
136    
137      print "#document\n";
138    
139      my $out;
140      if ($mode[2] eq 'html') {
141        $time1 = time;
142        $out = \( $doc->inner_html );
143        $time2 = time;
144        $time{serialize_xml} = $time2 - $time1;
145      } else { # test
146        $time1 = time;
147        $out = test_serialize ($doc);
148        $time2 = time;
149        $time{serialize_test} = $time2 - $time1;
150      }
151      print STDOUT Encode::encode ('utf-8', $$out);
152      print STDOUT "\n";
153  } else {  } else {
154    print STDOUT "Status: 404 Not Found\nContent-Type: text/plain; charset=us-ascii\n\n404";    print STDOUT "Status: 404 Not Found\nContent-Type: text/plain; charset=us-ascii\n\n404";
155    exit;    exit;

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24