Parent Directory
|
Revision Log
++ ChangeLog 11 Aug 2007 13:54:20 -0000 2007-08-11 Wakaba <wakaba@suika.fam.cx> * cc.cgi, parser-manakai.cgi, parser.cgi: Use |Message::CGI::HTTP| instead of |SuikaWiki::Input::HTTP|. 2007-08-05 Wakaba <wakaba@suika.fam.cx> * cc-interface.en.html: IMT |application/atom+xml| is added. Link to |cc-todo| is added. 2007-07-24 Wakaba <wakaba@suika.fam.cx> * error-description.xml: Description for "after body", "bare etago", and "bogus end tag" are added.
| 1 | #!/usr/bin/perl |
| 2 | use strict; |
| 3 | |
| 4 | use lib qw[/home/httpd/html/www/markup/html/whatpm |
| 5 | /home/wakaba/work/manakai2/lib]; |
| 6 | use CGI::Carp qw[fatalsToBrowser]; |
| 7 | use Time::HiRes qw/time/; |
| 8 | |
| 9 | use Message::CGI::HTTP; |
| 10 | my $http = Message::CGI::HTTP->new; |
| 11 | |
| 12 | ## TODO: _charset_ |
| 13 | |
| 14 | my $mode = $http->get_meta_variable ('PATH_INFO'); |
| 15 | ## TODO: decode unreserved characters |
| 16 | |
| 17 | if ($mode eq '/html' or $mode eq '/test') { |
| 18 | require Encode; |
| 19 | require Whatpm::HTML; |
| 20 | require Whatpm::NanoDOM; |
| 21 | |
| 22 | my $s = $http->get_parameter ('s'); |
| 23 | if (length $s > 1000_000) { |
| 24 | print STDOUT "Status: 400 Document Too Long\nContent-Type: text/plain; charset=us-ascii\n\nToo long"; |
| 25 | exit; |
| 26 | } |
| 27 | |
| 28 | my $time1 = time; |
| 29 | $s = Encode::decode ('utf-8', $s); |
| 30 | my $time2 = time; |
| 31 | my %time = (decode => $time2 - $time1); |
| 32 | my $char_length = length $s; |
| 33 | |
| 34 | print STDOUT "Content-Type: text/plain; charset=utf-8\n\n"; |
| 35 | |
| 36< |