Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 107299 - httpd.conf: AddDefaultCharset ISO-8859-1 isn't upstream default
Summary: httpd.conf: AddDefaultCharset ISO-8859-1 isn't upstream default
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: High trivial (vote)
Assignee: Apache Team - Bugzilla Reports
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-26 09:37 UTC by Tom S.
Modified: 2006-06-28 23:30 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
AddDefaultCharset Off: explanation excerpted from Apache httpd online documentation (httpd.conf.patch,1016 bytes, patch)
2005-09-26 09:51 UTC, Tom S.
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tom S. 2005-09-26 09:37:40 UTC
The AddDefaultCharset value "[will] override any charset specified in the body
of the response via a META element ... [and] should only be used when all of the
text resources to which it applies are known to be in that character encoding
and it is too inconvenient to label their charset individually". [1]

For this reason, upstream httpd-std.conf.in doesn't set a default charset. [2]

[1]
http://httpd.apache.org/docs/2.0/mod/core.html#adddefaultcharset

[2]
http://svn.apache.org/viewcvs.cgi/httpd/httpd/branches/2.0.x/docs/conf/httpd-std.conf.in?rev=151264&view=markup

Reproducible: Didn't try
Steps to Reproduce:
Comment 1 Tom S. 2005-09-26 09:51:00 UTC
Created attachment 69273 [details, diff]
AddDefaultCharset Off: explanation excerpted from Apache httpd online documentation

Patch provides an explanation excerpted from Apache httpd online documentation
(if a more specific comment than "setting [this] site-wide default does more
harm than good" is desired). ;o)
Comment 2 kavol 2006-01-15 11:26:55 UTC
I just merged the config today to be compatible with the new Gentoo style (which does not use the common conf file anymore) and I was quite disappointed ... I did not go through it very carefully (who the hell would read nerly 40 KBs? - you cannot effectively use diff, since it is _very_ different), so I missed a few things, one of which was AddDefaultCharset ... quite a surprise that pages stopped working and there is no obvious reason until you telnet to a machine and see ISO-8859-1 in the headers while the whole site uses UTF-8!

I know I should talk politely but I cannot help my self - this is STUPID! - I would not say that this harsh if there is not a comment:

"as the standard dictates that a page is in iso-8859-1 (latin1) unless specified otherwise i.e. you are merely stating the obvious" ... if a page is in UTF-8 then it is nonsense that 'it is obvious that the page is in iso-8859-1', where the hell the author of this got the belief that for all the pages served by standard apache installations 'it is obvious that the encoding is not "specified otherwise"'?!

uff, really sorry, but I spent a lot of time at it unnecessarily, just because someone's arogant thought that the Western languages are the only ones in the Universe :-(
Comment 3 kavol 2006-04-25 02:33:54 UTC
knock knock? is there anybody going to fix this? I just run into it again ...
Comment 4 Michael Stewart (vericgar) (RETIRED) gentoo-dev 2006-05-15 19:53:12 UTC
This is fixed with the configuration sync I did with apache 2.0.58.
Comment 5 cilly 2006-06-28 21:32:35 UTC
I think removing the complete section was unnecessary. Commenting it would have been enough.

Since I am running gentoo on utf-8 I need the setting and it was very convenient to have it in place.

Please, add the section again and use a more compatible default option, i.e. off:

#
# Specify a default charset for all pages sent out. This is
# always a good idea and opens the door for future internationalisation
# of your web site, should you ever want it. Specifying it as
# a default does little harm; as the standard dictates that a page
# is in iso-8859-1 (latin1) unless specified otherwise i.e. you
# are merely stating the obvious. There are also some security
# reasons in browsers, related to javascript and URL parsing
# which encourage you to always set a default char set.
#
#AddDefaultCharset ISO-8859-1
#AddDefaultCharset UTF-8
AddDefaultCharset Off
Comment 6 kavol 2006-06-28 23:30:02 UTC
(In reply to comment #5)
> I think removing the complete section was unnecessary. Commenting it would
> have been enough.

I agree ... however the comment text is nonsense - see the above comments, or read the standards

> Since I am running gentoo on utf-8 I need the setting

I do not understand - why do you *need* it?

I am using utf-8 too, but some php scripts send output in iso-8859-2 (for historical reasons), so setting utf-8 as default would do much harm since http headers overrule html head (which is the place where the scripts put the charset parameter)