I have a mod_perl-2 handler that uses custom_response() to display error messages if something goes wrong:
$r->custom_response(Apache2::Const::SERVER_ERROR, $error); return Apache2::Const::SERVER_ERROR; That almost works fine, but the trouble is that the Content-Type header is always set to "text/html; charset=iso-8859-1", in which the charset, at least, is potentially wrong: all the pages in my software produce UTF-8 and are normally output with Content-Type "application/xhtml+xml; charset=utf-8". How do I set the Content-Type when issuing a custom_reponse()? The usual thing of calling $r->content_type("application/xhtml+xml; charset=utf-8"); doesn't seem to work in this case.