mapbox / mapbox/mapbox-java

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

Đang mở
#979 6 bình luận 0 reaction 1 người được giao Xem trên GitHub

@osana đang làm issue này rồi.

Từ ngày 18/4/2019.

Ngôn ngữ chính
Java
Star
438
Fork
117
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.