DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36790>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36790


[EMAIL PROTECTED] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |




------- Additional Comments From [EMAIL PROTECTED]  2005-09-24 19:17 -------
I understand the character encoding defaults to ISO-8859-1, but I guess it boils
down to for the following servlet code, shouldn't the Content-Type be
"application/x-foobar"? Tomcat 5.0.28 is sending
"application/x-foobar;charset=utf-8".

    protected void doGet(HttpServletRequest request, HttpServletResponse 
response)
    throws ServletException, java.io.IOException {
                response.setContentType("text/html; charset=utf-8");
                response.setContentType("application/x-foobar");
                response.getOutputStream().println(new 
java.util.Date().toString());
                response.getOutputStream().close();
    }

The spec doesn't seem clear on what happens when setContentType() is called a
second time without a charset, but it does seem clear that "charset" should only
get added for "text/*" MIME types.

Is the standard clear on whether "charset" should be sent if the servlet does 
this?

                response.setContentType("text/html; charset=utf-8");
                response.setContentType("text/html");

Should the response default back to ISO-8859-1, and should the Content-Type have
";charset=ISO-8859-1" appended?

SRV.5.4 Internationalization
...
The setCharacterEncoding, setContentType, and
setLocale methods can be called repeatedly to change the character encoding.
Calls made after the servlet response’s getWriter method has been called or 
after
the response is committed have no effect on the character encoding. Calls to
setContentType set the character encoding only if the given content type string
provides a value for the charset attribute.
...
In the case of HTTP, the locale is communicated via the Content-
Language header, the character encoding as part of the Content-Type header for
text media types.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to