From 661b6a98d5ecec37c13dcabf2d752cb9d56c955c Mon Sep 17 00:00:00 2001 From: "pavol.zibrita" Date: Sun, 26 Dec 2010 21:18:22 +0000 Subject: [PATCH] - added hack to fix broken Collator for Czech Locale "cs" git-svn-id: https://osmand.googlecode.com/svn/trunk@861 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8 --- OsmAnd/src/net/osmand/RegionAddressRepositoryBinary.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/RegionAddressRepositoryBinary.java b/OsmAnd/src/net/osmand/RegionAddressRepositoryBinary.java index 97a52e9d15..3c1c56b863 100644 --- a/OsmAnd/src/net/osmand/RegionAddressRepositoryBinary.java +++ b/OsmAnd/src/net/osmand/RegionAddressRepositoryBinary.java @@ -8,6 +8,7 @@ import java.text.Collator; import java.util.Collection; import java.util.LinkedHashMap; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.TreeMap; @@ -36,7 +37,13 @@ public class RegionAddressRepositoryBinary implements RegionAddressRepository { public RegionAddressRepositoryBinary(BinaryMapIndexReader file, String name) { this.file = file; this.region = name; - this.collator = Collator.getInstance(); + //This is hack, as collator seems to be broken for "cs"-Czech country, things like Z-ΕΎ don't match, and "cz" fixes this + if ("cs".equals(Locale.getDefault().getLanguage())) { + this.collator = Collator.getInstance(new Locale("cz", Locale.getDefault().getCountry(),Locale.getDefault().getVariant())); + //hack end + } else { + this.collator = Collator.getInstance(); + } this.collator.setStrength(Collator.PRIMARY); //ignores also case this.postCodes = new TreeMap(collator); }