[PATCH] Fix Nominatim search non-latin queries
Export this patch
Submitting query to Nominatim with non-latin characters fails and no
results are displayed. Using the data-urlencode option of curl encodes
the query properly.
---
scripts/mepo_ui_menu_reposition_nominatim.sh | 2 +-
scripts/mepo_ui_menu_search_nominatim.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
Thanks, applied!
diff --git a/scripts/mepo_ui_menu_reposition_nominatim.sh b/scripts/mepo_ui_menu_reposition_nominatim.sh
index e854dc8..dcb455f 100755
--- a/scripts/mepo_ui_menu_reposition_nominatim.sh
@@ -37,7 +37,7 @@ main() {
echo "$QUERY" | grep -q . || err "Blank search query"
RESULT="$(
- curl -Ss "${MEPO_ENDPOINT_NOMINATIM_SEARCH}?format=json&q=$QUERY" |
+ curl -GSs --data-urlencode "q=$QUERY" "${MEPO_ENDPOINT_NOMINATIM_SEARCH}?format=json" |
jq '.[] | "\(.display_name) \(.lat) \(.lon)" ' |
PROMPT="Pick result" mepo_ui_helper_menu.sh
)"
diff --git a/scripts/mepo_ui_menu_search_nominatim.sh b/scripts/mepo_ui_menu_search_nominatim.sh
index 5b454d7..819a27b 100755
--- a/scripts/mepo_ui_menu_search_nominatim.sh
@@ -33,7 +33,7 @@ main() {
VIEWBOX="$MEPO_TL_LON,$MEPO_TL_LAT,$MEPO_BR_LON,$MEPO_BR_LAT"
JSONRESULTS="$(
- curl -Ss "${MEPO_ENDPOINT_NOMINATIM_SEARCH}?format=json&q=$QUERY&viewbox=$VIEWBOX&bounded=1&limit=50&extratags=1"
+ curl -GSs --data-urlencode "q=$QUERY" "${MEPO_ENDPOINT_NOMINATIM_SEARCH}?format=json&viewbox=$VIEWBOX&bounded=1&limit=50&extratags=1"
)"
PINSETUPCOMMANDS='
--
2.47.0