Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 85203 invoked from network); 8 Apr 2011 15:43:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Apr 2011 15:43:07 -0000 Received: (qmail 92036 invoked by uid 500); 8 Apr 2011 15:43:04 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 91870 invoked by uid 500); 8 Apr 2011 15:43:03 -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 91861 invoked by uid 99); 8 Apr 2011 15:43:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Apr 2011 15:43:03 +0000 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests=FREEMAIL_FROM,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.26 as permitted sender) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Apr 2011 15:42:59 +0000 Received: from isper.nabble.com ([192.168.236.156]) by sam.nabble.com with esmtp (Exim 4.69) (envelope-from ) id 1Q8DpW-0004dW-Oa for users@tomcat.apache.org; Fri, 08 Apr 2011 08:42:38 -0700 Message-ID: <31353009.post@talk.nabble.com> Date: Fri, 8 Apr 2011 08:42:38 -0700 (PDT) From: =?UTF-8?Q?Tomislav_Brklja=C4=8Di=C4=87?= To: users@tomcat.apache.org Subject: Re: [ win xp and win server 2003 ] tomcat utf8 encoding In-Reply-To: <4D9F1E51.8040800@christopherschultz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Nabble-From: tomislav.brkljacic@gmail.com References: <31342723.post@talk.nabble.com> <4D9DD566.7050402@ice-sa.com> <31343818.post@talk.nabble.com> <4D9DE5B1.90906@ice-sa.com> <31349626.post@talk.nabble.com> <4D9F1E51.8040800@christopherschultz.net> The remote machine gives the wrong "result". I wrote on the mailing list of the BPM software, the discussion is still alive. Maybe i could try to force a CharacterEncodingFilter filter on tomcat. Something like=20 http://www.onthoo.com/blog/programming/2005/07/characterencodingfilter.html this . I will definitely try with Wireshark. thx Christopher Schultz-2 wrote: >=20 > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 >=20 > Tom, >=20 > On 4/8/2011 4:19 AM, Tomislav Brklja=C4=8Di=C4=87 wrote: >> Ok, this is what i did. >>=20 >> 1. updated the java runtime so they match on both machines >=20 > Not a bad idea, but probably didn't affect anything. >=20 >> Tried to run the examples, but still the same result. >>=20 >> 2. installed livehttpheaders for firefox and ran the examples upload. >> This is the output from livehttp from my local machine (the same is on >> the >> server machine) : >=20 > So... is the local machine the one that does or does not work? Comparing > the two that DO work would be a good idea. >=20 >> Content-Type: multipart/form-data; >> boundary=3D---------------------------55652821543 >=20 > Note the lack of a character encoding (in the main request header). This > is appropriate for multipart/form-data content. >=20 >> Content-Disposition: form-data; name=3D"attach_file"; >> filename=3D"pri=C3=84=C2=8Duva.txt" >> Content-Type: text/plain >>=20 >> asdasdasd >> -----------------------------55652821543-- >=20 > A couple of things: >=20 > 1. I'm surprised that no Content-Length was sent along with the file. >=20 > 2. Note that the filename has non-US-ASCII characters shown there. > I wonder if that's LiveHttpHeaders's interpretation of the header > (and in what encoding) or if that's what's on the wire. >=20 >=20 > I suspect that ff is just using utf-8 to send the filename. Tomcat may > interpret it as US-ASCII and give you an odd result. Actually... for > multipart, Tomcat shouldn't be involved: this may be a problem with the > library you are using for file uploads. You should definitely ask on the > BPM mailing list. >=20 > Here's one thing you can do: >=20 > String brokenString =3D part.getFilename(); // or whatever >=20 > String fixedString > =3D new String(brokenString.getBytes("US-ASCII"), "UTF-8")); >=20 > That will re-encode the bytes sent from the client UTF-8. This wil only > work if: >=20 > 1. The client actually sent the data in UTF-8 >=20 > 2. Your multipart handler actually assumed that US-ASCII was correct >=20 > 3. No alteration of the bytes has occurred by the interpretation > as US-ASCII >=20 > If any of the above are NOT true, you are basically stuck. >=20 > It would be worth it to look at the bytes are they are traversing the > network -- say, with Wireshark -- to determine whether the filename is > actually encoded in UTF-8 or some other encoding. >=20 > Hope that helps, > - -chris > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.10 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ >=20 > iEYEARECAAYFAk2fHlAACgkQ9CaO5/Lv0PAJpwCeLrK7QVnL8bEkyfXow8Thj6UD > TpEAoJgmtujwwN+VvvCHQzUHZsf9e2qO > =3D9LWc > -----END PGP SIGNATURE----- >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org >=20 >=20 >=20 --=20 View this message in context: http://old.nabble.com/--win-xp-and-win-server= -2003---tomcat-utf8-encoding-tp31342723p31353009.html Sent from the Tomcat - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org