Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@apache.org Received: (qmail 65021 invoked from network); 20 Feb 2002 22:42:35 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 20 Feb 2002 22:42:35 -0000 Received: (qmail 22066 invoked by uid 97); 20 Feb 2002 22:42:33 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-dev@jakarta.apache.org Received: (qmail 22042 invoked by uid 97); 20 Feb 2002 22:42:33 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 22021 invoked by uid 50); 20 Feb 2002 22:42:32 -0000 Date: 20 Feb 2002 22:42:32 -0000 Message-ID: <20020220224232.22020.qmail@nagoya.betaversion.org> From: bugzilla@apache.org To: tomcat-dev@jakarta.apache.org Cc: Subject: DO NOT REPLY [Bug 6569] - setLocale() doesn't set the Content-Type charset attribute X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6569 setLocale() doesn't set the Content-Type charset attribute hans@gefionsoftware.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|FIXED | ------- Additional Comments From hans@gefionsoftware.com 2002-02-20 22:42 ------- Thanks for the speedy fix. Unfortunately, it doesn't look like it's solving the problem correctly. The new version of setLocale() looks like this: public void setLocale(Locale locale) { [...] this.locale = locale; if ((this.encoding == null) && (this.context != null)) { CharsetMapper mapper = context.getCharsetMapper(); this.encoding = mapper.getCharset(locale); if ((contentType != null) && (contentType.indexOf(';') < 0)) { contentType = contentType + ";charset=" + encoding; } } } This means the new Locale doesn't override an existing encoding, which it should (to be consistent with how a charset in setContentType() is handled, if nothing else). My suggestion is this: public void setLocale(Locale locale) { [...] this.locale = locale; if (this.context != null) { CharsetMapper mapper = context.getCharsetMapper(); this.encoding = mapper.getCharset(locale); if (contentType != null) { if (contentType.indexOf(';') < 0)) { contentType = contentType + ";charset=" + encoding; } else { // Replace the previous charset int i = contentType.indexOf(';'); contentType = contentType.substring(0, i) + ";charset=" + encoding; } } } } -- To unsubscribe, e-mail: For additional commands, e-mail: