mapbox / mapbox/mapbox-java

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

未关闭
#979 6 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@osana 已经在做这个了。

开始于 2019年4月18日。

主要语言
Java
星标
438
派生
117
PR 合并指标
30 天内没有已合并 PR

描述

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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。