From ecb496d21f88a9fe375d95b1a0dd00653e910d81 Mon Sep 17 00:00:00 2001 From: Chumva Date: Fri, 25 May 2018 12:45:12 +0300 Subject: [PATCH] fixed url decoding --- .../wikivoyage/explore/WikivoyageExploreActivity.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/WikivoyageExploreActivity.java b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/WikivoyageExploreActivity.java index 82a73cd9b1..68e4d0455b 100644 --- a/OsmAnd/src/net/osmand/plus/wikivoyage/explore/WikivoyageExploreActivity.java +++ b/OsmAnd/src/net/osmand/plus/wikivoyage/explore/WikivoyageExploreActivity.java @@ -38,7 +38,9 @@ import net.osmand.plus.wikivoyage.data.TravelDbHelper; import net.osmand.plus.wikivoyage.search.WikivoyageSearchDialogFragment; import net.osmand.util.Algorithms; +import java.io.UnsupportedEncodingException; import java.lang.ref.WeakReference; +import java.net.URLDecoder; import java.util.ArrayList; import java.util.List; @@ -181,6 +183,13 @@ public class WikivoyageExploreActivity extends TabActivity implements DownloadEv && host.contains("osmand.net") && path.startsWith("/travel")) { String query = data.getQueryParameter("title"); + try { + if (!Algorithms.isEmpty(query)) { + query = URLDecoder.decode(query, "UTF-8"); + } + } catch (UnsupportedEncodingException e) { + System.err.println(e.getMessage()); + } String selectedLang = data.getQueryParameter("lang"); if (!Algorithms.isEmpty(query) && !Algorithms.isEmpty(selectedLang)) { WikivoyageArticleDialogFragment.showInstance(app, getSupportFragmentManager(), query, selectedLang);