tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Brownell <davi...@pacbell.net>
Subject Re: [PATCH] Tomcat on EBCDIC machines...
Date Sat, 20 Nov 1999 06:11:11 GMT
costin@eng.sun.com wrote:
> 
> I think your problem exposed 3 bugs:
>
> - we shouldn't default to the system encoding, but to ISOxxx ( as
> specified in HTTP specs - XXX read it again :-)

That's correct:  ISO-8859-1, which is the low eight bits of Unicode.
Applies only to 'text/html' response bodies though (whoever wrote
up that bit of the HTTP spec broke a big chunk of the MIME world).

For MIME in general, all "text/*" content types default to ASCII.


> - right now we return the headers using the same encoding as the body -
> instead of using whatever HTTP requires ( we can/should have different encoding
> for head/body !).

Best to treat the HTTP header as straight ASCII -- it's guaranteed
never to have characters other than that.


> - a big one - we don't do any content negotiation ( the request can force
> a different encoding, and I don't think it's only the servlet that should deal
> with that, probably Tomcat needs to set the default out encoding to whatever
> the request asks)

Application needs to have some say-so here.  Request specifies a list
of acceptible encodings for the response, and application chooses.
For example, if ASCII and EUC-JP are accepted, don't use ASCII if the
response is written with Japanese characters.

The servlet API had support for application interaction there, last
time I looked.  As of API 1.1 for sure -- and I don't think I saw
any of the relevant methods get deprecated.


> Probably only the first one is urgent/important, and if the Response change
> doesn't solve the problem I'll just commit your patch and wait for better
> ideea.

Second one is a really severe protocol bug; don't ship a Tomcat
milestone without fixing it (and the first one).

- dave

Mime
View raw message