You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Skating Jim <sk...@yahoo.com> on 2006/02/01 06:41:18 UTC

Re: [users@httpd] AddDefaultCharset and Multiple Encodings

I agree with your distinction between what Apache does
and how the browser responds to it.  Sorry for the
inaccuracy on my part.

The basis for my comment is that the Apache
documentation for AddDefaultCharset says:

"This should override any charset specified in the
body of the response via a META  element, though the
exact behavior is often dependent on the user's client
configuration."

Mozilla 1.7.12 and Opera 8.51 give priority to the
HTTP charset encoding and therefore comply with the
"should" statement in the Apache documentation.  IE6.0
gives priority to the Content-Type meta element in the
HTML head instead.

Unfortunately, taking the advice of the Apache
documentation prevents the more compliant browsers
from correctly rendering the content from a given
server using the AddDefaultCharset directive unless
that same charset encoding is used across the entire
site.  Although Apache is not responsible for this,
compliance with the "should" statement in its
documentation is.

I think the Apache documentation should not recommend
overriding the meta element, because what's in the
meta element is most likely to be correct.  Does this
make sense or am I still off target?

Jim 


--- Joshua Slive <jo...@slive.ca> wrote:

(...cut...)

> No, it doesn't.  It set's an HTTP charset only when
> none exists. 
> Perhaps what you are seeing is the fact that
> browsers will use the
> charset specified in the html <head> when no HTTP
> charset is present. 
> But this has really nothing to do with apache.

(...cut...)

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
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] AddDefaultCharset and Multiple Encodings

Posted by Octavian Rasnita <or...@fcc.ro>.
From: "Skating Jim" <sk...@yahoo.com>

> I agree with your distinction between what Apache does
> and how the browser responds to it.  Sorry for the
> inaccuracy on my part.
>
> The basis for my comment is that the Apache
> documentation for AddDefaultCharset says:
>
> "This should override any charset specified in the
> body of the response via a META  element, though the
> exact behavior is often dependent on the user's client
> configuration."
>
> Mozilla 1.7.12 and Opera 8.51 give priority to the
> HTTP charset encoding and therefore comply with the
> "should" statement in the Apache documentation.  IE6.0
> gives priority to the Content-Type meta element in the
> HTML head instead.
>

Hmm, strange. I have seen that if I use the charset ISO-8859-2 in a meta tag
in an xhtml file, IE 6 uses the ISO-8859-1 charset specified in the HTTP
headers even though I don't want this.

> Unfortunately, taking the advice of the Apache
> documentation prevents the more compliant browsers
> from correctly rendering the content from a given
> server using the AddDefaultCharset directive unless
> that same charset encoding is used across the entire
> site.  Although Apache is not responsible for this,
> compliance with the "should" statement in its
> documentation is.
>
> I think the Apache documentation should not recommend
> overriding the meta element, because what's in the
> meta element is most likely to be correct.  Does this
> make sense or am I still off target?
>

Yes I also think that the prefered charset should be the one specified in
the meta tag, especially in xhtml files, because they are a kind of XML
files and I know that the XML files should be able to have the charset
specified inside.

Teddy


---------------------------------------------------------------------
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


[users@httpd] AddDefaultCharset

Posted by Farid Hamjavar <ha...@unm.edu>.
Greetings;

Is  setting AddDefaultCharset to "off"
a security risk under apache (ver. is  2.0.46 under Linux)

Thank you,
Farid

---------------------------------------------------------------------
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] AddDefaultCharset and Multiple Encodings

Posted by Skating Jim <sk...@yahoo.com>.
--- André Malo <nd...@perlig.de> wrote:

> Actually the W3C specifies exactly the opposite.

You're right.  I'm sorry that I didn't read this
correctly.  I think the frustration of my dilema has
caused me to see things that aren't there.  I still
don't understand the logic behind this scheme, but I
have to agree that the Apache documentation, the HTTP
spec, and the HTML specs all agree, and that as usual,
Gecko and Opera are the most compliant browsers.

Thank you for setting me straight, and sorry again to
everyone who had to suffer through my ineptness.

Jim

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
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] AddDefaultCharset and Multiple Encodings

Posted by André Malo <nd...@perlig.de>.
* Skating Jim <sk...@yahoo.com> wrote:

> I agree that this is a browser issue, but the W3C HTML
> 4.01 specification document very clearly specifies
> that charset attributes in HTML elements take highest
> priority, followed by Content-Type META tags, followed
> by HTTP header charsets.  The XHTML1.0 specification
> also gives prioity to META tags over HTTP headers.

Actually the W3C specifies exactly the opposite. From
<http://www.w3.org/TR/html4/charset.html>:

| To sum up, conforming user agents must observe the following priorities when
| determining a document's character encoding (from highest priority to
| lowest):

|   1. An HTTP "charset" parameter in a "Content-Type" field.
|   2. A META declaration with "http-equiv" set to "Content-Type" and a
|      value set for "charset".
|   3. The charset attribute set on an element that designates an external
|      resource.

nd

---------------------------------------------------------------------
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] AddDefaultCharset and Multiple Encodings

Posted by Skating Jim <sk...@yahoo.com>.
--- Nick Kew <ni...@webthing.com> wrote:

> On Wednesday 01 February 2006 05:41, Skating Jim
> wrote:
> 
> > The basis for my comment is that the Apache
> > documentation for AddDefaultCharset says:
> >
> > "This should override any charset specified in the
> > body of the response via a META  element, though
> the
> > exact behavior is often dependent on the user's
> client
> > configuration."
> 
> That's just FYI.  What matters is not the Apache
> documentation,
> but the public internetworking specs: RFC2616
> (HTTP), and the
> MIME one whose number I don't recollect without
> looking it up.
> 
> So what the apache documentation is really telling
> you is how
> an Internet-compliant browser works.  It qualifies
> that by noting
> that some browsers may be broken.
> 
> -- 
> Nick Kew

I agree that this is a browser issue, but the W3C HTML
4.01 specification document very clearly specifies
that charset attributes in HTML elements take highest
priority, followed by Content-Type META tags, followed
by HTTP header charsets.  The XHTML1.0 specification
also gives prioity to META tags over HTTP headers.

The HTTP RFC 2616 says in section 3.4.1 that
"recipients MUST respect the charset label provided by
the sender...".

I don't see a real inconsistency with this since its
applicability is limited to the HTTP header.  The HTTP
specification doesn't attempt to make rules about how
specific content types might override its settings. 
Unfortunately it seems many/most browser implementors
got scared by the shouting "MUST" and forgot to think
about the ramification of ignoring the HTML/XHTML
specifications.  The "FYI" in the Apache documentation
is directly in conflict with the W3C HTML and XHTML
specifications because it explicitly says the HTTP
header should override HTML META elements.

Until browsers improve (better FYI's and HTTP spec
verbage might help encourage this), the
AddDefaultCharset directive can't be used if
Windows-1250 and ISO-8859-2 coexist on the same
server.

Jim


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
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] AddDefaultCharset and Multiple Encodings

Posted by Nick Kew <ni...@webthing.com>.
On Wednesday 01 February 2006 05:41, Skating Jim wrote:

> The basis for my comment is that the Apache
> documentation for AddDefaultCharset says:
>
> "This should override any charset specified in the
> body of the response via a META  element, though the
> exact behavior is often dependent on the user's client
> configuration."

That's just FYI.  What matters is not the Apache documentation,
but the public internetworking specs: RFC2616 (HTTP), and the
MIME one whose number I don't recollect without looking it up.

So what the apache documentation is really telling you is how
an Internet-compliant browser works.  It qualifies that by noting
that some browsers may be broken.

-- 
Nick Kew

---------------------------------------------------------------------
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