Hello!  Let me get the system specs out of the way first...

Apache: 2.0.50
mod_perl: 1.99_16
Apreq2: 2.04-dev
Perl: 5.8.5

I am attempting to set the charset value in the response headers to 'utf8', but I can't seem to get it to drop the 'iso-8859-1' value for some reason.

I began with the following code: (Assuming $ContentType = "text/html")

             $r->content_type("$ContentType; charset=utf-8");
             $r->print($Request);

And the response headers look like this:

        Date: Wed, 08 Sep 2004 15:29:56 GMT
        Server: Apache/2.0.50 (Unix) mod_perl/1.99_16 Perl/v5.8.5
        Content-Type: text/html; charset=ISO-8859-1


Then I changed the code to use the content_encoding function:

$r->content_type($ContentType); #("$ContentType; charset=utf-8");
$r->content_encoding("utf8");
$r->print($Request);


And now the response headers look like this:

        Date: Wed, 08 Sep 2004 15:33:21 GMT
        Server: Apache/2.0.50 (Unix) mod_perl/1.99_16 Perl/v5.8.5
        Content-Type: text/html; charset=ISO-8859-1
        Content-Encoding: utf8

For some reason, I cannot get the "Content-Type:" string to just be "text/html" or "text/html; charset=utf8". I have a feeling that "Content-Encoding" has nothing to do with what I am trying to achieve here.... Am I missing something completely obvious here? Any help would be appreciated.

Thanks,
Chris Jacobson


-- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Reply via email to