Return-Path: Delivered-To: apmail-commons-dev-archive@www.apache.org Received: (qmail 67949 invoked from network); 12 Feb 2010 15:17:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 Feb 2010 15:17:12 -0000 Received: (qmail 102 invoked by uid 500); 12 Feb 2010 15:17:11 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 99869 invoked by uid 500); 12 Feb 2010 15:17:11 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 99857 invoked by uid 99); 12 Feb 2010 15:17:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Feb 2010 15:17:11 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [209.85.219.217] (HELO mail-ew0-f217.google.com) (209.85.219.217) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Feb 2010 15:17:01 +0000 Received: by ewy9 with SMTP id 9so3230843ewy.35 for ; Fri, 12 Feb 2010 07:16:41 -0800 (PST) MIME-Version: 1.0 Sender: tcurdt@vafer.org Received: by 10.213.1.143 with SMTP id 15mr1178588ebf.42.1265987800963; Fri, 12 Feb 2010 07:16:40 -0800 (PST) In-Reply-To: <876362h5l9.fsf_-_@v35516.1blu.de> References: <87mxzeh7uh.fsf@v35516.1blu.de> <6c59d89a1002120623h42b558a6o246aa15d7658eef3@mail.gmail.com> <876362h5l9.fsf_-_@v35516.1blu.de> Date: Fri, 12 Feb 2010 16:16:40 +0100 X-Google-Sender-Auth: 2e5005709ee60c1c Message-ID: <6c59d89a1002120716p6084977fmefa3c84cd5184a9@mail.gmail.com> Subject: Re: [compress] equalsIgnoreCase in Factories (was Re: New release soon?) From: Torsten Curdt To: Commons Developers List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org > Saw that. =A0While looking through the patch I realized we are using > equalsIgnoreCase in the factories which is not such a good idea since > this is locale dependent and the Turkish lowercase of "ZIP" is not > "zip". Wow, didn't know that! I found the comment here quite interesting http://nikolajlindberg.blogspot.com/2008/03/beware-of-java-comparing-turki= sh.html Seems we can easily fix this with toLowerCase(Locale.US) in this case. As a side note: For more serious comparisons it seems like a "Collator" is the right thing to use http://java.sun.com/j2se/1.4.2/docs/api/java/text/Collator.html Never came across that class before :) Interesting! > =A0I'll change that to locale insensitive comparisons - actually > comparisons using the English locale soon. Yeah, we should fix that before the next release as well. cheers -- Torsten --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org