You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Steffen Kaiser <St...@inf.fh-bonn-rhein-sieg.de> on 2007/02/28 16:02:46 UTC

[users@httpd] Add charset in depend of meta tag

Hello,

is it possible in Apache 2.0.54 to add the charset to the header only, when
there is none in the meta tags of the served page? Or to send the charset
of the page?

The threads "Russian page not displayed properly in Apache 2.0" and "meta
http-equiv useless??" suggest no, the answer therein is:

either use AddDefaultCharset or have the correct charset specified in a meta
tag of all pages.

Actually, I don't want to do neither of them, but apply utf-8 to all pages
without a meta tag, because I re-publish pages I do not control. Is there
some module for it possibly?

I stumbled across something called "Mod_charset", but in the conjunction
of "Russian Apache" and PHP only.

Thanks,

Steffen


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Add charset in depend of meta tag

Posted by Nick Kew <ni...@webthing.com>.
On Wed, 28 Feb 2007 16:02:46 +0100
Steffen Kaiser <St...@inf.fh-bonn-rhein-sieg.de> wrote:

> Hello,
> 
> is it possible in Apache 2.0.54 to add the charset to the header
> only, when there is none in the meta tags of the served page? Or to
> send the charset of the page?

Apache doesn't look inside the page for <meta>.

If that's a problem, you can use a parsing module like mod_proxy_html
or mod_publisher.  They'll look for a <meta ...> if there's no
charset declared in the HTTP headers, and ensure the correct header
is sent.

> I stumbled across something called "Mod_charset", but in the
> conjunction of "Russian Apache" and PHP only.

mod_charset_lite just converts between charsets, and needs to be told
the "to" and "from" charsets in httpd.conf.  AFAIK mod_charset is
similar, but check its page: maybe it can sniff nowadays.

-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.apachetutor.org/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org