Hi all,
I stumpled upon a problem with encoding of URLs in Pharo.
I am using the Google Geocoding API. For example I want to get the result
of:
http://maps.googleapis.com/maps/api/geocode/json?address=Willemstad,+Curaça…
When one enters this in a Browser a correct JSON response is returned.
If I do the following:
*(Url absoluteFromText: '
http://maps.googleapis.com/maps/api/geocode/json?address=Willemstad,+Curaça…)
retrieveContents contents.*
I get an error back grom Google.
When digging through the code I found that in ZnHTTPSocketFacade the
following happens:
*'
http://maps.googleapis.com/maps/api/geocode/json?address=Willemstad,+Curaça…
asZnUrl *
And the result of this is:
http://maps.googleapis.com/maps/api/geocode/json?address=Willemstad,+Cura%C…
*
*
Which Google does not know how to handle and then returns an error.
Does anyone have an idea how I could get contents from a URL which has
special chars like '*ç'?*
Or is there a way to convert all special chars to to their 'normal'
counterparts, like *ç -> c?*
*
*
Cheers,
Dennis