Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 89339 invoked from network); 18 Jun 2008 20:58:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Jun 2008 20:58:53 -0000 Received: (qmail 38785 invoked by uid 500); 18 Jun 2008 20:58:33 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 38762 invoked by uid 500); 18 Jun 2008 20:58:33 -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 38750 invoked by uid 99); 18 Jun 2008 20:58:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Jun 2008 13:58:33 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [68.142.198.97] (HELO web31302.mail.mud.yahoo.com) (68.142.198.97) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 18 Jun 2008 20:57:41 +0000 Received: (qmail 33855 invoked by uid 60001); 18 Jun 2008 20:56:58 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Message-ID; b=GNysNz+Ysm6/7G+P0uBnsOcAgNKcgbUcIA0PLGiguMGqeWLdxrvCgJhTlJgspYOc32QWuAVULvWmadz8kAY1LdMJt0tpKJqPO3/HTTo36+q5EbSLsqxaiu96gbzYHKsjIBhS4/5JQ/zohpcAKUPfLkgJv+sj71oHCqy/ZaQ2NNM=; Received: from [213.60.24.174] by web31302.mail.mud.yahoo.com via HTTP; Wed, 18 Jun 2008 13:56:58 PDT X-Mailer: YahooMailRC/975.45 YahooMailWebService/0.7.199 Date: Wed, 18 Jun 2008 13:56:58 -0700 (PDT) From: nch Subject: Re: Character encoding To: Tomcat Users List MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1201060922-1213822618=:33824" Message-ID: <520565.33824.qm@web31302.mail.mud.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org --0-1201060922-1213822618=:33824 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable You say:=0ATomcat does not use any environment variables. The only settings= that=0Aaffect the interpretation of the URI are the "URIEncoding" and=0A"u= seBody..." settings on the . Are you using more than one=0Aconne= ctor? Are you using Apache httpd out in front of Tomcat?=0A=0APerhaps the J= VM does and so tomcat read them indirectly through it??=0A=0ACheers=0A=0A= =0A=0A----- Original Message ----=0AFrom: Christopher Schultz =0ATo: Tomcat Users List =0ASent:= Wednesday, June 18, 2008 9:42:21 PM=0ASubject: Re: Character encoding=0A= =0A-----BEGIN PGP SIGNED MESSAGE-----=0AHash: SHA1=0A=0Anch,=0A=0Anch wrote= :=0A| - I do remote debugging through Eclipse to both tomcat on windows=0A|= (same machine as eclipse, though) and tomcat on debian.=0A=0AOkay, remote = debugging should not affect the server, but I'm still=0Awondering if the se= rver.xml you think you are using is the one actually=0Abeing used. Try sett= ing the port to something crazy like=0A12345 and restarting. If= you can still contact the server, then you are=0Aeither editing the wrong = server.xml (there should only be one!) or your=0Achanges are not being pick= ed up.=0A=0A| - When I send "pira=F1a" it is always encoded into the URL as= =0A| "pira%C3%B1a", whether running tomcat on windows, debian or even=0A| r= unning my app into Jetty.=0A=0AThat's because your browser is encoding it, = not the server. So, it=0Adoesn't depend on the server configuration (except= possibly for the page=0Aencoding, which often directs the browser to use u= tf-8 URI encoding).=0A=0A| - If I type "pira=F1a" on http://www.us-webmaste= rs.com/Decode-URLs/ and=0A| switch browser encoding display between ISO-885= 9-1 and UTF-8, I can=0A| see that when ISO-8859-1, then it displays "pira= =C3=B1a", when UTF-8, it=0A| displays "pira=F1a".=0A=0AI'm not sure what yo= u think you're doing, there. When I paste that word=0Ainto the box to decod= e, I get broken output. There is no indication as=0Ato what encoding the se= rver expects for URIs.=0A=0ASwitching browser interpretation of the resulti= ng page does not seem to=0Aprove anything. The server never advertises any = encoding to use, so the=0Abrowser just chooses whatever it wants. My browse= r chooses ISO-8859-1.=0AWhen I switch it to UTF-8, I see the expected inter= pretation. I'm not=0Asure what I just learned.=0A=0A| - Something could be = wrong in my debian environment. How can I find=0A| out about which env. var= ables is tomcat using?=0A=0ATomcat does not use any environment variables. = The only settings that=0Aaffect the interpretation of the URI are the "URIE= ncoding" and=0A"useBody..." settings on the . Are you using more= than one=0Aconnector? Are you using Apache httpd out in front of Tomcat?= =0A=0A| - If I try to manually decode the returned parameter into my=0A| co= ntroller by using URLDecoder.decode(query, "UTF-8") then I can see=0A| no d= ifference. That is, when debugging the tomcat on windows the=0A| result is = "pira=F1a" while debugging the one on debian the result is=0A| "pira=C3=B1a= ".=0A=0ASo, running this:=0A=0AURLDecoder.decode(URLEncoder.encode("pira=F1= a", "UTF-8"), "UTF-8");=0A=0A...gives you "pira=C3=B1a" on your debian syst= em? That doesn't seem right.=0A=0A| - Is URLDecoder#decode environment depe= ndent?=0A=0ANope. As long as you always provide the encoding to bs used, yo= u should=0Abe fine.=0A=0A- -chris=0A-----BEGIN PGP SIGNATURE-----=0AVersion= : GnuPG v1.4.9 (MingW32)=0AComment: Using GnuPG with Mozilla - http://enigm= ail.mozdev.org=0A=0AiEUEARECAAYFAkhZZR0ACgkQ9CaO5/Lv0PCbTQCgm/eWN4Xphx9GQ4C= TPZXNXdvn=0ArigAlA5l2731npViTS8ofT4cqSi5F6o=3D=0A=3Dg6gT=0A-----END PGP SIG= NATURE-----=0A=0A----------------------------------------------------------= -----------=0ATo start a new topic, e-mail: users@tomcat.apache.org=0ATo un= subscribe, e-mail: users-unsubscribe@tomcat.apache.org=0AFor additional com= mands, e-mail: users-help@tomcat.apache.org=0A=0A=0A --0-1201060922-1213822618=:33824--