Hi I'm consuming the web service of nominatim to reverse geocoding in my .NET Application but the xml I get in my String variable is not the same as I see in the browser and accents the spoils me and makes me strange characters when using coordinates in asia Any idea??? Thanks |
Nominatim always returns its results in UTF-8 encoding. It looks like you are trying to interpret the result using some windows encoding. According to this stackoverflow question you need to set Hi. This must be done before using the web client.DownloadString webClient.Encoding = Encoding.UTF8; Thanks
(19 Mar '14, 15:58)
kintela
|
Could you give some examples (of the code that fails, the data that you're expecting, and the data that you get back)?
Of course. For example this request http://nominatim.openstreetmap.org/reverse?format=xml&lat=50,9683209807591&lon=2,57099452814137&zoom=18&addressdetails=1
The result: D 70, farm, Bettencourt-Rivière, Amiens, Somme, Picardía, Francia metropolitana, 80890, Francia
But in my C# code
public string Inversa(double latitud, double longitud) { WebClient webClient = new WebClient();
I get: D 70, farm, Bettencourt-Rivière, Amiens, Somme, Picardie, France métropolitaine, 80890, France
Thanks