I'm trying to write a VBA code that interacts with the Google's Distance Matrix Api, and returns me the distance between two points. The problem is, when I try to use latin letters (like ã), it returns a Invalid Destination error:
<status>INVALID_REQUEST</status>
<error_message>Invalid request. Invalid 'destinations' parameter.</error_message>
</DistanceMatrixResponse>
The Url I'm using is this:
https://maps.googleapis.com/maps/api/distancematrix/xml?units=metric&origins=Fortaleza&destinations=São+Paulo&key=" & myAPIK
Do you guys know any way to get around this?
But when I use UTF-8 code instead of the word itself, it returns me the distance that I wanted:
https://maps.googleapis.com/maps/api/distancematrix/xml?units=metric&origins=Fortaleza&destinations=S%C3%A3o+Paulo&key=" & myAPIK
I also already tried putting the language (pt-BR) in the Url, but it didn't work.