Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 94588 invoked from network); 24 Apr 2007 19:59:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Apr 2007 19:59:41 -0000 Received: (qmail 62030 invoked by uid 500); 24 Apr 2007 19:59:33 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 62010 invoked by uid 500); 24 Apr 2007 19:59:33 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 61999 invoked by uid 99); 24 Apr 2007 19:59:33 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Apr 2007 12:59:33 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [206.190.39.71] (HELO web53411.mail.re2.yahoo.com) (206.190.39.71) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 24 Apr 2007 12:59:26 -0700 Received: (qmail 92192 invoked by uid 60001); 24 Apr 2007 19:59:04 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=yjRH3snWxxe2zTPEAGuv7VJc1bfhDL7TuK+4oNzC0CihtEoc1HBQxAY+kkEmXONWL7r/8WBAoYhXar7NmWfcuK9Qh0T/GONTQABMt7NYDlVfS3H03tguQsFkTvpv+JuZlg2pZ2UEkyEJgRoE5u9HqNKvuLmna6Df/WhuDvgUG88=; X-YMail-OSG: .DnyZVoVM1m0_B3YYr9osMRCWPNrsVVwwamHOzFlnG8t_kFJL8bugl5OHbVCYIo8OgjSVkMtb0bIlz3hI4l0g5JxxnU8AHnw7krmcl4zBPlZZCL.PP4hf5VRa7wxfjIw Received: from [216.129.80.238] by web53411.mail.re2.yahoo.com via HTTP; Tue, 24 Apr 2007 12:59:04 PDT Date: Tue, 24 Apr 2007 12:59:04 -0700 (PDT) From: Sean Bridges Subject: Re: charset encoding bug To: users@tomcat.apache.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <671775.90264.qm@web53411.mail.re2.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org Thanks for the reply Rashmi. I did a little more digging, and it seems this bug only appears when the locale is set. My full servlet code is, import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class ContentType extends HttpServlet { protected void doGet( HttpServletRequest arg0, HttpServletResponse arg1) throws ServletException, IOException { arg1.setLocale(arg0.getLocale()); arg1.setContentType("application/foobar"); arg1.getOutputStream(). write(arg1.getContentType().getBytes()); } } In this case the response will be, application/foobar;charset=ISO-8859-1 This is with a fresh install of tomcat 5.5.23 with no other webapps or libraries installed. If I take out the call to setLocale(...) the charset is not appended to the content type. In our webapp, the setLocale(...) method is being called within Spring's DispatcherServlet. I think this is a bug, as setLocale(...) should not modify the content type. Thanks, Sean __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org