From 22266857c0a11becf7bf5f18c6007cf5cefb649a Mon Sep 17 00:00:00 2001 From: Alexander Sytnyk Date: Thu, 13 Jul 2017 18:16:37 +0300 Subject: [PATCH 1/2] Fix #3884 --- OsmAnd-java/src/net/osmand/map/OsmandRegions.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/OsmAnd-java/src/net/osmand/map/OsmandRegions.java b/OsmAnd-java/src/net/osmand/map/OsmandRegions.java index 3b3d6efe49..07fbdb5f67 100644 --- a/OsmAnd-java/src/net/osmand/map/OsmandRegions.java +++ b/OsmAnd-java/src/net/osmand/map/OsmandRegions.java @@ -17,6 +17,7 @@ import net.osmand.util.MapUtils; import java.io.File; import java.io.IOException; import java.io.RandomAccessFile; +import java.text.Collator; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -664,9 +665,11 @@ public class OsmandRegions { } } Comparator nameComparator = new Comparator() { + final Collator collator = Collator.getInstance(); + @Override public int compare(WorldRegion w1, WorldRegion w2) { - return w1.getLocaleName().compareTo(w2.getLocaleName()); + return collator.compare(w1.getLocaleName(), w2.getLocaleName()); } }; sortSubregions(world, nameComparator); From a5de1f4b05f423ee133c87ac2bdfaa9c71c73a8b Mon Sep 17 00:00:00 2001 From: Alexander Sytnyk Date: Thu, 13 Jul 2017 18:24:27 +0300 Subject: [PATCH 2/2] Change collator --- OsmAnd-java/src/net/osmand/map/OsmandRegions.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd-java/src/net/osmand/map/OsmandRegions.java b/OsmAnd-java/src/net/osmand/map/OsmandRegions.java index 07fbdb5f67..8384af4362 100644 --- a/OsmAnd-java/src/net/osmand/map/OsmandRegions.java +++ b/OsmAnd-java/src/net/osmand/map/OsmandRegions.java @@ -1,6 +1,7 @@ package net.osmand.map; +import net.osmand.OsmAndCollator; import net.osmand.PlatformUtil; import net.osmand.ResultMatcher; import net.osmand.binary.BinaryMapDataObject; @@ -17,7 +18,6 @@ import net.osmand.util.MapUtils; import java.io.File; import java.io.IOException; import java.io.RandomAccessFile; -import java.text.Collator; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -665,7 +665,7 @@ public class OsmandRegions { } } Comparator nameComparator = new Comparator() { - final Collator collator = Collator.getInstance(); + final net.osmand.Collator collator = OsmAndCollator.primaryCollator(); @Override public int compare(WorldRegion w1, WorldRegion w2) {