Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 65969 invoked from network); 4 Mar 2008 18:14:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Mar 2008 18:14:46 -0000 Received: (qmail 80705 invoked by uid 500); 4 Mar 2008 18:14:40 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 80038 invoked by uid 500); 4 Mar 2008 18:14:38 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 80027 invoked by uid 500); 4 Mar 2008 18:14:38 -0000 Delivered-To: apmail-jakarta-tomcat-dev@jakarta.apache.org Received: (qmail 80024 invoked by uid 99); 4 Mar 2008 18:14:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Mar 2008 10:14:38 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.130] (HELO eos.apache.org) (140.211.11.130) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Mar 2008 18:13:59 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id 9583AD2C7 for ; Tue, 4 Mar 2008 18:14:19 +0000 (GMT) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Apache Wiki To: tomcat-dev@jakarta.apache.org Date: Tue, 04 Mar 2008 18:14:19 -0000 Message-ID: <20080304181419.677.5800@eos.apache.org> Subject: [Tomcat Wiki] Update of "FAQ/CharacterEncoding" by markt X-Virus-Checked: Checked by ClamAV on apache.org Dear Wiki user, You have subscribed to a wiki page or wiki category on "Tomcat Wiki" for change notification. The following page has been changed by markt: http://wiki.apache.org/tomcat/FAQ/CharacterEncoding The comment on the change is: More Q lists ------------------------------------------------------------------------------ = Character Encoding Issues = == Questions == + 1. [#Q1 What is the default character encoding?] + 1. [#Q2 How do I change how GET parameters are interpreted?] + 1. [#Q3 How do I change how POST parameters are interpreted?] + 1. [#Q4 How can I test if my configuration will work correctly?] + 1. [#Q5 I'm having a problem with character encoding in Tomcat 5] + == Answers == - '''What is the default character encoding?''' + [[Anchor(Q1)]]'''What is the default character encoding?''' If a character encoding is not specified, the Servlet specification requires that an encoding of ISO 8859-1 is used. - '''How do I change how GET parameters are interpreted?''' + [[Anchor(Q2)]]'''How do I change how GET parameters are interpreted?''' Set the URIEncoding parameter on the Connector element in server.xml. - '''How do I change how POST parameters are interpreted?''' + [[Anchor(Q3)]]'''How do I change how POST parameters are interpreted?''' POST requests should specify the encoding of the parameters and values they send. Since many clients fail to set an explicit encoding, the default is used (ISO 8859-1). In many cases this is not the preferred interpretation so one can employ a javax.servlet.Filter to set request encodings. Writing such a filter is trivial. Furthermore Tomcat already comes with such an example filter. Please take a look at: 4.x:: @@ -29, +35 @@ webapps/examples/WEB-INF/classes/filters/SetCharacterEncodingFilter.java }}} - '''How can I test if my configuration will work correctly?''' + [[Anchor(Q4)]]'''How can I test if my configuration will work correctly?''' The following sample JSP should work on a clean Tomcat install for any input. If you set the URIEncoding="UTF-8" on the connector, it will also work with method="GET". {{{ @@ -56, +62 @@ }}} - '''I'm having a problem with character encoding in tomcat 5''' + [[Anchor(Q5)]]'''I'm having a problem with character encoding in Tomcat 5''' In Tomcat 5 - there have been issues reported with respect to character encoding (usually of the the form "request.setCharacterEncoding(String) doesn't work"). Odds are, its not a bug. Before filing a bug report, see these bug reports as well as any bug reports linked to these bug reports: --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org