From users-return-205510-apmail-tomcat-users-archive=tomcat.apache.org@tomcat.apache.org Wed Dec 02 16:17:42 2009 Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 90255 invoked from network); 2 Dec 2009 16:17:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Dec 2009 16:17:42 -0000 Received: (qmail 86652 invoked by uid 500); 2 Dec 2009 16:17:37 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 86583 invoked by uid 500); 2 Dec 2009 16:17:37 -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 86572 invoked by uid 99); 2 Dec 2009 16:17:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Dec 2009 16:17:37 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [76.96.62.96] (HELO QMTA09.westchester.pa.mail.comcast.net) (76.96.62.96) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Dec 2009 16:17:26 +0000 Received: from OMTA13.westchester.pa.mail.comcast.net ([76.96.62.52]) by QMTA09.westchester.pa.mail.comcast.net with comcast id CCu11d00G17dt5G59GH5NV; Wed, 02 Dec 2009 16:17:05 +0000 Received: from [192.168.1.200] ([69.143.128.194]) by OMTA13.westchester.pa.mail.comcast.net with comcast id CGH51d0094BnRt93ZGH51t; Wed, 02 Dec 2009 16:17:05 +0000 Message-ID: <4B169301.8060702@christopherschultz.net> Date: Wed, 02 Dec 2009 11:17:05 -0500 From: Christopher Schultz User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.4pre) Gecko/20090915 Thunderbird/3.0b4 MIME-Version: 1.0 To: Tomcat Users List Subject: Re: Char Encoding text streams on Tomcat 5.5 and Linux References: <4B0FAA19.7090701@metadatatechnology.com> <4B0FB287.5060007@metadatatechnology.com> <4B0FF8E4.4060205@ice-sa.com> <4B142761.80000@christopherschultz.net> <4B1465BC.20901@ice-sa.com> <4B158FDD.1010000@christopherschultz.net> In-Reply-To: X-Enigmail-Version: 0.97a Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Elli, On 12/2/2009 2:40 AM, Elli Albek wrote: > On your Linux box type “locale” + enter. The results should be UTF 8. If not > change it. I can have my locale set to whatever I'd like, thank you very much. > You can also set it in the file encoding java environment > variable as suggested above as extra safety measure. Well, you can check it's value. By default, it's UTF-8 on my system (as mentioned in my post if you read the whole thing). > Tomcat’s logic of determining the encoding from the request only applies > when Tomcat is parsing text in the request. Tomcat's logic of determining the encoding for the request is mandated by the servlet spec and the HTTP spec. In this case, Tomcat /was/ parsing text in the request: we are talking about POST data, here. Elli, please read the posts before replying. > However if you read from the stream directly, using request.getInputStream() > you are getting binary data. When you create java.io.Reader from that input > stream you need to specify the encoding, or it will default to the file > system encoding. Yes. If you look at the source code to Tomcat, you'll see that the encoding used comes from the request headers, or defaults to ISO-8859-1. I'm not going to repeat this again. If you create your own Reader (which you shouldn't be doing), you're on your own. In this case, nobody was creating their own Reader. > The fact that tomcat is using ISO-8859-1 to read characters is not relevant > if you are reading from the stream directly and use your own Reader to > convert to characters. ..which I wasn't doing. Rather than repeatedly complaining about how you haven't read this thread properly, I'm simply going to stop. > I am assuming this is a likely cause, since the XML > parsing succeeds Okay, I can't help myself: when did we start talking about XML? - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAksWkwEACgkQ9CaO5/Lv0PCI1QCgkC9SPmdWkHDPiLmEqE9l3xGm ASIAoLViW6EMWL67yVxBfMEJDXj9utR4 =R438 -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org