[Israel.pm] CGI and charset mistmatch

Issac Goldstand 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'),
> $q->start_html(
> -head=>$q->meta(
> {
> -http_equiv => 'Content-Type',
> -content=>"text/html; charset=ISO-8859-8"
> }
> )
> ),
> $q->h1('Analysis results');
> output_analysis(analyze($input));
> print $q->end_html;
>
> --- end code snippet ---
>
> Thanks.
>
> -- 
> Shlomo Yona
> shlomo at cs.haifa.ac.il
> http://cs.haifa.ac.il/~shlomo/
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://www.perl.org.il/mailman/listinfo/perl
>




More information about the Perl mailing list