mapbox / mapbox/mapbox-java

Special character `á` incorrectly encoded in raw Geocoding API request URL

Aberta
#979 6 comentários 0 reações 1 responsável Ver no GitHub

@osana já está trabalhando nisso.

Desde 18/4/2019.

Linguagem predominante
Java
Estrelas
438
Forks
117
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

What kind of issue is this?

- [ ] **Questions** are better to ask on [Stack Overflow](https://stackoverflow.com/questions/tagged/mapbox+android). We are actively monitoring the questions there and oftentimes, others have already asked a similar question.
- [ ] **Feature request** should start off by describing the problem the feature will resolve. Please open a GitHub ticket beforehand with information about the feature to spark some discussion about the topic and once you have our support.
- [x] **Bug Report** can be reported using the provided template below:

#### Expected Behavior

Using a geocoder with the Mapbox Maps SDK for Android should support special characters. So the search `Santa Catarina Mártir,Puebla` should yield results whether the Geocoding API call is initiated in a browser or via the Mapbox Maps SDK for Android.

#### Current Behavior

Expected results return when geocoding api request is initiated in a browser (i.e. in the Search Playground), but when using the SDK the raw geocoding API request URL includes the incorrect encoding for special character `á` so no results are returned.

#### Possible Solution

#### Steps to Reproduce

1. Run your app (including a geocoder) in Android Studio and use this code to log out the raw geocoding API request URL:
```
Log.d("GeocodingActivity", "onResponse: call.request() = " + call.request());
```

2. Enter the search "Santa Catarina Mártir,Puebla" and grab the geocoding API request URL.
3. See that it doesn't return any results and the query contains incorrect encoding: https://api.mapbox.com/geocoding/v5/mapbox.places/Santa+Catarina+M%25C3%25A1rtir%252CPuebla.json?access_token={{access-token}}&country=mx%2Cmx&types=poi%2Caddress&language=en
4. Compare to the same search with the same parameters in the [Search Playground](https://docs.mapbox.com/search-playground/#{%22url%22:%22%22,%22index%22:%22mapbox.places%22,%22staging%22:false,%22onCountry%22:true,%22onType%22:false,%22onProximity%22:false,%22onBBOX%22:false,%22onLimit%22:true,%22onLanguage%22:true,%22countries%22:[{%22name%22:%22Mexico%22,%22code%22:%22mx%22}],%22proximity%22:%22%22,%22typeToggle%22:{%22country%22:false,%22region%22:false,%22district%22:false,%22postcode%22:false,%22locality%22:false,%22place%22:true,%22neighborhood%22:false,%22address%22:true,%22poi%22:true},%22types%22:[%22poi%22,%22address%22,%22place%22],%22bbox%22:%22%22,%22limit%22:%221%22,%22autocomplete%22:false,%22languages%22:[{%22code%22:%22en%22,%22name%22:%22English%22}],%22languageStrict%22:false,%22onDebug%22:false,%22selectedLayer%22:%22%22,%22debugClick%22:{},%22localsearch%22:false,%22query%22:%22Santa%20Catarina%20M%C3%A1rtir,%20puebla%22}) and the raw request: https://api.mapbox.com/geocoding/v5/mapbox.places/Santa%20Catarina%20M%C3%A1rtir%2C%20puebla.json?access_token={{access_token}}&cachebuster=1551922406234&autocomplete=false&country=mx&limit=1&language=en

#### Context (Environment)

using gradle, compiling the following versions:
```
compile "com.mapbox.mapboxsdk:mapbox-sdk-services:4.5.0"
compile "com.mapbox.mapboxsdk:mapbox-sdk-geojson:4.5.0"
```

#### Detailed Description

#### Possible Implementation

cc @langsmith

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.