You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Markus Wichitill <ma...@gmx.de> on 2005/04/20 19:06:17 UTC
Re: mp2: who is responsible for setting charset?
JH Foo wrote:
> I have a need to set the charset in the header from the default 8859-1 to UTF-8. In CGI I simply set the header method($q->header(-charset=>'utf8');
> Can anyone tell me the modperl equivalent, possibly with the Apache2::RequestRec or Apache::Request object?
$r->content_type("text/html; charset=$charset");
Re: how to take out the default charset append?
Posted by Carl Johnstone <mo...@fadetoblack.demon.co.uk>.
> Please help me with one more related question: if I am to simply use
> $r->content_type('text/html'), the final render to the client comes with
> ';charset=8859-1' appended to the header. Is this the result of Apache,
> or mod_perl? Is there any way I can just render Content-Type: text/html
> without a character set in the header?
You've probably got
AddDefaultCharset 8859-1
in your apache config, ("On" == "iso-8859-1")change it to:
AddDefaultCharset Off
See:
http://httpd.apache.org/docs-2.0/mod/core.html#adddefaultcharset
Carl
mp2: how to take out the default charset append?
Posted by Foo Ji-Haw <jh...@nexlabs.com>.
Hallo Markus,
Thanks for the tip. I really needed to get that off.
Please help me with one more related question: if I am to simply use
$r->content_type('text/html'), the final render to the client comes with
';charset=8859-1' appended to the header. Is this the result of Apache,
or mod_perl? Is there any way I can just render Content-Type: text/html
without a character set in the header?
Markus Wichitill wrote:
> JH Foo wrote:
>
>> I have a need to set the charset in the header from the default
>> 8859-1 to UTF-8. In CGI I simply set the header
>> method($q->header(-charset=>'utf8');
>> Can anyone tell me the modperl equivalent, possibly with the
>> Apache2::RequestRec or Apache::Request object?
>
>
> $r->content_type("text/html; charset=$charset");
>