charset « Tomcat « JSP-Servlet Q&A

1. response.setContentType() always trim the space between "; charset"?

I'm using Tomcat 6.0.20, HttpServlet my servlet code are as followings :-

response.setContentType("application/xml; charset=utf-8");
but each time i will got the content type as :
which is without the space between " ; ". May i ...

2. Preventing Tomcat from appending charset to binary content types

We have a Restlet based service that returns the following response:

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1, Restlet-Framework/2.0.7
X-Powered-By: Servlet 2.4; JBoss-4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181417)/JBossWeb-2.0
Content-Disposition: inline; filename=Time_for_a_breather.pdf
Date: Fri, 13 May 2011 23:41:24 GMT
Accept-Ranges: bytes
Content-Type: application/pdf;charset=UTF-8
Content-Length: ...

3. Tomcat and charset