#!/usr/bin/perl use strict; my $name = $ENV{PATH_INFO}; $name =~ s!^/!!; $name =~ s/%([0-9A-Fa-f]{2})/pack 'C', hex $1/ge; $name =~ s/[\x00-\x1F]/ /g; my $name_c = $name; $name_c =~ s/[\\";\x20\x7F-\xFF]//g; print "Content-Type: text/html; charset=$name_c "; my $s = q[]. ($ENV{QUERY_STRING} =~ /c1/ ? q[] : $ENV{QUERY_STRING} =~ /c2/ ? q[] : q[]) . q[
onload
onload
document.charset
:
document.characterSet
:
document.inputEncoding
:
document.defaultCharset
:
document.xmlEncoding
:
];
print $s;