Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problems with apache2 and charsets

278 views
Skip to first unread message

Carles Pagès

unread,
Feb 6, 2008, 5:50:17 PM2/6/08
to
Hello,

My apache seems to ignore the charset meta data in the html files, so
iso-8859-1 htmls are not properly displayed. If I store them in utf-8,
then there is no problem, even if iso-8859-1 is specified in the meta
headers.

If I specify the default charset in the apache conf file to be
iso-8859-1 then the iso pages are shown correctly but not utf-8 ones.

So, does anyone know what could be causing this behaviour? I'm using
apache2 in debian stable, if that helps.

Thanks in advance.

--
"Crazy, but that's how it goes
Millions of people living as foes
Maybe it's not too late
To learn how to love, and forget how to hate"


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Gilles Mocellin

unread,
Feb 6, 2008, 6:40:12 PM2/6/08
to
Le Wednesday 06 February 2008 23:45:34 Carles Pagès, vous avez écrit :
> Hello,
>
> My apache seems to ignore the charset meta data in the html files, so
> iso-8859-1 htmls are not properly displayed. If I store them in utf-8,
> then there is no problem, even if iso-8859-1 is specified in the meta
> headers.
>
> If I specify the default charset in the apache conf file to be
> iso-8859-1 then the iso pages are shown correctly but not utf-8 ones.
>
> So, does anyone know what could be causing this behaviour? I'm using
> apache2 in debian stable, if that helps.
>
> Thanks in advance.

UTF8 is a forced default in Debian's Apache2.
To make apache respect meta tags, comment that line :

gilles@guitare:~$ cat /etc/apache2/conf.d/charset
# Read the documentation before enabling AddDefaultCharset.
# In general, it is only a good idea if you know that all your files
# have this encoding. It will override any encoding given in the files
# in meta http-equiv or xml encoding tags.

#AddDefaultCharset UTF-8

signature.asc

Carles Pagès

unread,
Feb 7, 2008, 3:40:11 AM2/7/08
to
Thanks a lot! That solved my problem. I didn't know the default charset
was being forced in that file. I saw the "AddDefaultCharset" directive
commented in apache2.conf and assumed it wasn't being forced anywhere
else. Moreover, this comment stating that the directive overrides any
encoding on the meta does not appear in my conf.d/charset file.

By the way, why is utf-8 forced by default? I've looked it up but found
no explanation.

0 new messages