commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Curdt <tcu...@apache.org>
Subject Re: [compress] equalsIgnoreCase in Factories (was Re: New release soon?)
Date Fri, 12 Feb 2010 15:16:40 GMT
> Saw that.  While 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-turkish.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!

>  I'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


Mime
View raw message