- 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
This commit is contained in:
pavol.zibrita 2010-12-26 21:18:22 +00:00
parent 89730c9579
commit 661b6a98d5

View file

@ -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 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<String, PostCode>(collator);
}