tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Luehe <Jan.Lu...@Sun.COM>
Subject Re: cvs commit: jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote
Date Wed, 28 Jul 2004 18:28:49 GMT

Remy Maucherat wrote:
> Jan Luehe wrote:
>> Bill,
>>> then I'd suggest simply
>>> doing:
>>>    setCharacterEncoding(getCharacterEncoding());
>>> in Response.getWriter (since the spec only requires that we identify the
>>> charset when using a Writer, and we don't really know what it is when 
>>> using
>>> OutputStream).
>> The problem with this is that if you call getWriter() (with your 
>> proposed fix) followed by getContentType(), the returned content type
>> will include a charset, which is against the spec of getContentType():
>>   * If no character encoding has been specified, the
>>   * charset parameter is omitted.
>> This is why we need to append the default charset to the value of the
>> Content-Type header, if no char encoding has been specified.
> This is not acceptable, and is not an option, so you shouldn't be using 
> "we need", because we won't ;)

This is why I said "we need" instead of "we will". ;-)

I agreed with Bill's proposed solution in principle (include charset
only when using writer), but pointed out that his proposed patch
would break ServletResponse.getContentType(), which is why I said that
if we were to include the default charset (if no charset was specified
and if a writer was being used), we'd have to do it at the time of
generating the header.

I'll reply to your other mail shortly.


> The right solution is IMO to point out the issues to the specification 
> people.
> Rémy
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message