diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java index 29fb2e578d..12b1b0d497 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/AmenityMenuBuilder.java @@ -48,7 +48,9 @@ import net.osmand.util.OpeningHoursParser; import org.apache.commons.logging.Log; +import java.io.UnsupportedEncodingException; import java.math.RoundingMode; +import java.net.URLDecoder; import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; import java.util.ArrayList; @@ -784,20 +786,29 @@ public class AmenityMenuBuilder extends MenuBuilder { String wikidataValue = amenity.getAdditionalInfo(Amenity.WIKIDATA); String wikimediaValue = amenity.getAdditionalInfo(Amenity.WIKIMEDIA_COMMONS); if (!Algorithms.isEmpty(imageValue)) { - params.put("osm_image", imageValue); + params.put("osm_image", getDecodedAdditionalInfo(imageValue)); } if (!Algorithms.isEmpty(mapillaryValue)) { - params.put("osm_mapillary_key", mapillaryValue); + params.put("osm_mapillary_key", getDecodedAdditionalInfo(mapillaryValue)); } if (!Algorithms.isEmpty(wikidataValue)) { - params.put(Amenity.WIKIDATA, wikidataValue); + params.put(Amenity.WIKIDATA, getDecodedAdditionalInfo(wikidataValue)); } if (!Algorithms.isEmpty(wikimediaValue)) { - params.put(Amenity.WIKIMEDIA_COMMONS, wikimediaValue); + params.put(Amenity.WIKIMEDIA_COMMONS, getDecodedAdditionalInfo(wikimediaValue)); } return params; } + private String getDecodedAdditionalInfo(String additionalInfo) { + try { + return URLDecoder.decode(additionalInfo, "UTF-8"); + } catch (UnsupportedEncodingException e) { + LOG.error(e); + } + return additionalInfo; + } + private CollapsableView getPoiTypeCollapsableView(final Context context, boolean collapsed, @NonNull final List categoryTypes, final boolean poiAdditional, AmenityInfoRow textRow) {