Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 99411 invoked from network); 13 Nov 2009 15:17:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 13 Nov 2009 15:17:57 -0000 Received: (qmail 25875 invoked by uid 500); 13 Nov 2009 15:17:56 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 25789 invoked by uid 500); 13 Nov 2009 15:17:56 -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 25778 invoked by uid 99); 13 Nov 2009 15:17:56 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Nov 2009 15:17:56 +0000 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; Fri, 13 Nov 2009 15:17:43 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id 7D0E617D1A for ; Fri, 13 Nov 2009 15:17:22 +0000 (GMT) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Apache Wiki To: Apache Wiki Date: Fri, 13 Nov 2009 15:17:22 -0000 Message-ID: <20091113151722.3744.81257@eos.apache.org> Subject: =?utf-8?q?=5BTomcat_Wiki=5D_Update_of_=22FAQ/CharacterEncoding=22_by_Chri?= =?utf-8?q?stopherSchultz?= 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 ch= ange notification. The "FAQ/CharacterEncoding" page has been changed by ChristopherSchultz. http://wiki.apache.org/tomcat/FAQ/CharacterEncoding?action=3Ddiff&rev1=3D9&= rev2=3D10 -------------------------------------------------- = If a character encoding is not specified, the Servlet specification requi= res that an encoding of ISO-8859-1 is used. The character encoding for the = body of an HTTP message (request ''or'' response) is specified in the `Cont= ent-Type` header field. An example of such a header is `Content-Type: text/= html; charset=3DISO-8859-1` which explicitly states that the default (ISO-8= 859-1) is being used. = + References: [[http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.= 7.1|HTTP 1.1 Specification, Section 3.7.1]] + = <>'''How do I change how GET parameters are interpreted?''' = Tomcat will use ISO-8859-1 as the default character encoding of the entir= e URL, including the query string ("GET parameters"). @@ -26, +28 @@ = 1. Set the `URIEncoding` attribute on the element in server.= xml to something specific (e.g. `URIEncoding=3D"UTF-8"`). 1. Set the `useBodyEncodingForURI` attribute on the element = in server.xml to `true`. This will cause the Connector to use the request b= ody's encoding for GET parameters. + = + References: [[http://tomcat.apache.org/tomcat-6.0-doc/config/http.html|To= mcat 6 HTTP Connector]], [[http://tomcat.apache.org/tomcat-6.0-doc/config/h= ttp.html|Tomcat 6 AJP Connector]] = <>'''How do I change how POST parameters are interpreted?''' = @@ -92, +96 @@ = 1. [[http://jcp.org/aboutJava/communityprocess/mrel/jsr154/index2.html|J= ava Servlet Specification 2.5]] 1. [[http://jcp.org/aboutJava/communityprocess/final/jsr154/index.html|J= ava Servlet Specification 2.4]] - 1. [[http://www.w3.org/Protocols/rfc2616/rfc2616.txt|HTTP 1.1 Protocol]]= ] ([[http://www.w3.org/Protocols/rfc2616/rfc2616.html|hyperlinked version]]) + 1. [[http://www.w3.org/Protocols/rfc2616/rfc2616.txt|HTTP 1.1 Protocol]]= ([[http://www.w3.org/Protocols/rfc2616/rfc2616.html|hyperlinked version]]) 1. [[http://www.ietf.org/rfc/rfc2396.txt|URI Syntax]] 1. [[http://www.w3.org/Protocols/rfc822/|ARPA Internet Text Messages]] 1. [[http://www.w3.org/TR/html4|HTML 4]] = + ''Default encoding for request and response bodies'' + = + See 'Default Encoding for POST' below. + = ''Default encoding for GET'' = - The character set for HTTP query strings (that's the technical term for '= GET parameters') can be found in sections 2 and 2.1 the "URI Syntax" specif= ication. The character set is defined to be [[http://en.wikipedia.org/wiki/= ASCII|US-ASCII]]. Any character that does not map to US-ASCII must be encod= ed in some way. Section 2.1 of the URI Syntax specification says that chara= cters outside of US-ASCII must be encoded using `%` escape sequences: each = character is encoded as a literal `%` followed by the two hexadecimal codes= which indicate its character code. Thus, `a` (US-ASCII character code 0x97= ) is equivalent to `%97`. + The character set for HTTP query strings (that's the technical term for '= GET parameters') can be found in sections 2 and 2.1 the "URI Syntax" specif= ication. The character set is defined to be [[http://en.wikipedia.org/wiki/= ASCII|US-ASCII]]. Any character that does not map to US-ASCII must be encod= ed in some way. Section 2.1 of the URI Syntax specification says that chara= cters outside of US-ASCII must be encoded using `%` escape sequences: each = character is encoded as a literal `%` followed by the two hexadecimal codes= which indicate its character code. Thus, `a` (US-ASCII character code 0x97= ) is equivalent to `%97`. There ''is no default encoding for URIs'' specifi= ed anywhere, which is why there is a lot of confusion when it comes to deco= ding these values. = Some notes about the character encoding of URIs: 1. ISO-8859-1 and ASCII are compatible for character codes 0x20 to 0x7E,= so they are often used interchangeably. Most of the web uses ISO-8859-1 as= the default for query strings. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org