Evidar the change of special characters in URI writing

Asked

Viewed 93 times

0

I’m using the google maps API in my project but I’m having a small problem.

to mount the URL I am using a URI that concatenates with buildUpon like this in the example below.

Uri uriBase = Uri.parse(urlBase).buildUpon()
                    .appendQueryParameter(language, "pt-BR")
                    .appendQueryParameter(units, "metric")
                    .appendQueryParameter(origins, "Washington,DC")
                    .appendQueryParameter(destinations, "New+York+City,NY")
                    .appendQueryParameter(key, GOOGLE_API_KEY)
                    .build();

ate ai all right, the problem is that they are with the special characters like "," and " ". They are converted to their form url encodinggetting something like %2C or %2B, which may end up preventing google maps from identifying the address by returning empty json, I wonder if there is a way to prevent this conversion.

  • "(...) what can end up preventing (...)": Can or even prevents?

  • Currently I did not get problems, but until last year I was not getting return that way, which leaves me with a foot down in this case.

  • In principle the correct is to use (always) a encoded URI.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.