Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 84826 invoked from network); 21 Apr 2010 11:14:11 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 21 Apr 2010 11:14:11 -0000 Received: (qmail 72018 invoked by uid 500); 21 Apr 2010 11:14:07 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 71838 invoked by uid 500); 21 Apr 2010 11:14:05 -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 71829 invoked by uid 99); 21 Apr 2010 11:14:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Apr 2010 11:14:04 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of iamake@gmail.com designates 209.85.210.201 as permitted sender) Received: from [209.85.210.201] (HELO mail-yx0-f201.google.com) (209.85.210.201) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Apr 2010 11:13:56 +0000 Received: by yxe39 with SMTP id 39so1748930yxe.12 for ; Wed, 21 Apr 2010 04:13:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:references :in-reply-to:subject:date:message-id:mime-version:content-type :content-transfer-encoding:x-mailer:content-language:thread-index; bh=kp9EZ9IAkXwfef91LmXTSo+EHEnQW/pSwwzHSESL8DM=; b=yF5lXGtWYaAAN+avEhAUn2nEf9Qn62nS/vHij5Exhmb1rLZftZxcLYIqXbhN1RFPSN Ohh7cHondxpA7M1gXj4ZHaRuiS0gXDC1p7/yzTNhyxIkq+KbkrAkz1fULql+jU3oHxcK EbOfqzA1SkppgYOrRfuYDFHqYDPqPdjvEBqOQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:references:in-reply-to:subject:date:message-id:mime-version :content-type:content-transfer-encoding:x-mailer:content-language :thread-index; b=QsOnM8xAbp1S3+o19bzxCAAt9cvhFZZp250vjp+iMnHpIr0wctAPQSH4v4Ni8qXRp4 nfa1EnhnLztH343FiJVghIj11ohzLPMJRokpAYkSeHNu2MMNf9d4fQq3Zybk3uR152zo W5LkdYSFAXPb7m8ILhLrQrlIqACs0LCMN33r4= Received: by 10.100.200.4 with SMTP id x4mr20936727anf.125.1271848415756; Wed, 21 Apr 2010 04:13:35 -0700 (PDT) Received: from akenotebookvt (ppp-58-8-73-99.revip2.asianet.co.th [58.8.73.99]) by mx.google.com with ESMTPS id 23sm6521814iwn.10.2010.04.21.04.13.32 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 21 Apr 2010 04:13:34 -0700 (PDT) From: "Ake Tangkannaond" To: "'Tomcat Users List'" References: <284319.89173.qm@web26501.mail.ukl.yahoo.com> <03b901cae136$ff54edc0$fdfec940$@com> <153083.76262.qm@web26504.mail.ukl.yahoo.com> In-Reply-To: <153083.76262.qm@web26504.mail.ukl.yahoo.com> Subject: RE: UTF-8 encoding in Tomcat 6.0 Date: Wed, 21 Apr 2010 18:13:18 +0700 Message-ID: <001501cae143$a8297c70$f87c7550$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Content-language: en-us Thread-index: AcrhQWZdsJa5ns9zTE2PFCHoV7ty9wAASI1A Where do you see the recommendation of using filter to handle utf8 char = encoding in GET ? -Ake -----Original Message----- From: Mircea LUTIC [mailto:mircea_lutic@yahoo.com]=20 Sent: Wednesday, April 21, 2010 5:57 PM To: Tomcat Users List Subject: Re: UTF-8 encoding in Tomcat 6.0 The filter does get called on my GET request. In my understanding, a filter is the reccomended method of handling = UTF-8 for both GET & POST (as well as other methods like HEAD, PUT = etc.). When the request is "test.jsp?Name=3Dlarevolu%C8%9Bie" as in the example = page the EncodingFilter.doFilter function is being called and it calls=20 the EncodingFilter.check function as below Name=3Drequest.getParameter("Name"); =20 if (Name!=3Dnull) check(Name, lang); and the String Name is incorrect as mentionned in the comment below: void check(String Name, java.util.Locale lang) { int c8=3DName.codePointAt(8);//c8=3D200=3DC8 // should be 539=3D21Bh = =3D =C8=9B int c9=3DName.codePointAt(9);//c9=3D155=3D9B // should be 105=3D 69h = =3D i char ch[]=3D{Name.charAt(8),Name.charAt(9)}; int x=3Dc8+c9; //to have eclipse (Galileo) display the above String s=3Dnew String(ch);=20 } =20 server.xml contains the following: =20 This is because my tomcat 6 is set to work on 8060 with no redirect = because this is a debug setting. (some time ago I also had tomcat 5 on 8050 but at that time I didn't = check the UTF-8 issue) Thanks for you help. Mircea. ________________________________ From: Ake Tangkannaond To: Tomcat Users List Sent: Wed, 21 April, 2010 12:42:36 Subject: RE: UTF-8 encoding in Tomcat 6.0 Hi Mircea, That filter you wrote is for POST and it has nothing to do with GET = request. Have you check the documentation on the conf/server.xml on the following = line? -Ake From: Mircea LUTIC [mailto:mircea_lutic@yahoo.com]=20 Sent: Wednesday, April 21, 2010 3:40 PM To: users@tomcat.apache.org Subject: UTF-8 encoding in Tomcat 6.0 Hello, I'm having trouble convincing tomcat 6.0 to take UTF-8 strings. I created an encoding filter with no luck.=20 /** Here is the Utf8 Filter that fails for me in=20 Tomcat 6.0.20 / Eclipse-Galileo / Windows Vista (6.0.6002) <---> Firefox = 3.6.3. java version "1.6.0_20" Java(TM) SE Runtime Environment (build 1.6.0_20-b02) Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode) Everything is on my laptop (http://localhost:8060). =20 What I do is create a GET string (based on parameters from a = showModalDialog) by script and send it (from Firefox) to the (localhost) server=20 which is running under eclipse with a breakpoint in the = EncodingFilter. =20 Note that the system locale is ro_RO (may have an influence) *=20 * set in appl/WebContent/web.xml: *=20 EncodingFilter ro.lutic.transcode.EncodingFilter encoding UTF-8 *=20 * set in tomcat/conf/server.xml at http://www.w3.org/TR/html4/loose.dtd"> UTF-8 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org