[Israel.pm] CGI and charset mistmatch
margol at beamartyr.net
Tue Jun 1 14:33:04 PDT 2004
Maybe for whatever reason your server is configured to do that? I've been
caught with that a few times in the past (though admittedly, it's usually
the headers which the server mangles)
----- Original Message -----
From: "Shlomo Yona" <shlomo at cs.haifa.ac.il>
To: <perl at perl.org.il>
Sent: Wednesday, June 02, 2004 12:02 AM
Subject: [Israel.pm] CGI and charset mistmatch
> Hello, Mongers.
> I have a simple CGI script which is supposed to accept text
> in ISO-8859-8 and return text also in ISO-8859-8.
> The following CGI was supposed to do that, only that it
> somehow inserts
> <?xml version="1.0" encoding="iso-8859-1"?>
> as the first text in the response content.
> I suspect that this is CGI doing that, but I cannot seem to
> be able to prevent it to or at least cause it to write
> ISO-8859-8 instead. Any suggestions?
> --- begin code snippet ---
> #!/home/yona/perl/bin/perl # perl 5.8.4
> use strict;
> use warnings;
> use Morphology::Analyzer qw/analyze/;
> use Morphology::Analyzer::HTML qw/output_analysis/;
> use CGI;
> my $q = CGI->new;
> my $input = $q->param('input_text');
> print $q->header(-charset=>'ISO-8859-8'),
> -http_equiv => 'Content-Type',
> -content=>"text/html; charset=ISO-8859-8"
> $q->h1('Analysis results');
> print $q->end_html;
> --- end code snippet ---
> Shlomo Yona
> shlomo at cs.haifa.ac.il
> Perl mailing list
> Perl at perl.org.il
More information about the Perl