tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Barker" <>
Subject Re: svn commit: r371765 - /tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/connector/
Date Wed, 25 Jan 2006 05:25:26 GMT

"Remy Maucherat" <> wrote in message
> Bill Barker wrote:
>> It's relevant to the browser trying to display the code.  If you've
>> configured your browser's default encoding to EUC-JP, without the charset
>> you'll see a big mess when you hit a latin-1 page ;-).
> Obviously, this would only impact the case where ;charset=ISO-8859-1 would 
> be forcefully added to the content-type header for no good reason when the 
> user didn't specify any. This is the HTTP default encoding, and will not 
> change the behavior from the user perspective.

Yes, RFC 2616 does specify iso-latin-1 as the default for HTTP/1.1 clients. 
However, section 3.4.1 is also relevant for HTTP/1.0 clients (like, say, the 
TCK :).  In any case, it doesn't matter since section 5.4 of the servlet 
spec says "must".  Complaints go to the expert group;  here we just develop 

>> Yup, that's what it means :).  I'm sure you've played the blame-game by 
>> now,
>> and I'm not interested enough to do it myself.  It looks like it's trying 
>> to
>> avoid computing the entire header value each time the characterEncoding
>> changes.
> This whole thing is a huge mess right now. Hopefully, it's doing what it 
> should. You can also for example compare 
> o.a.c.connector.Response.setContentType with 
> o.a.coyote.Response.setContentType. I have to suppose substring and 
> concatenation is a very cool activity.

Yeah, the spec is a mess wrt characterEncoding.  Complaints to the same 
place as above :).  The problem is that we need to deal with such 
pathological cases as:
   response.setContentType("text/html; charset=EUC-JP");
   // Oops, I want French instead of Japanese

Since you can change your mind (according to the spec) many times before you 
actually grab the Writer, I don't really see a way around substring and 
concatenation being cool :).  Of course, I would love to be proven wrong :).

> Rémy 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message