NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum


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???


asked 19 Mar '14, 15:02

kintela's gravatar image

accept rate: 0%

edited 19 Mar '14, 16:07

SomeoneElse's gravatar image

SomeoneElse ♦

Could you give some examples (of the code that fails, the data that you're expecting, and the data that you get back)?

(19 Mar '14, 15:11) SomeoneElse ♦

Of course. For example this request,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();


            string cadena = "" + Convert.ToString(latitud) + "&lon=" + Convert.ToString(longitud) + "&zoom=18&addressdetails=1";

            string result = webClient.DownloadString(cadena);

            return result;
        catch (Exception e)
            throw e;

I get: D 70, farm, Bettencourt-Rivière, Amiens, Somme, Picardie, France métropolitaine, 80890, France


(19 Mar '14, 15:17) kintela

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 webClient.Encoding = System.Text.Encoding.UTF8 to enforce the correct encoding.

permanent link

answered 19 Mar '14, 15:40

lonvia's gravatar image

accept rate: 40%


This must be done before using the web client.DownloadString

webClient.Encoding = Encoding.UTF8;


(19 Mar '14, 15:58) kintela

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 19 Mar '14, 15:02

question was seen: 6,105 times

last updated: 19 Mar '14, 16:07

NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum