I am using a webservice to get a list of places. The places (country, state, and city) are being returned via xml in utf-8 format. When I view the places, all of the special characters do not display correctly, e.g. umlauts, accents, etc. For example some
German and south american cities. How can I convert these strings to display correctly on the web using c#. Encoding.Convert? convert to byte array? decode?
chaynop
Member
2 Points
2 Posts
Special characters not displaying correctly
Feb 07, 2012 05:05 PM|LINK
I am using a webservice to get a list of places. The places (country, state, and city) are being returned via xml in utf-8 format. When I view the places, all of the special characters do not display correctly, e.g. umlauts, accents, etc. For example some German and south american cities. How can I convert these strings to display correctly on the web using c#. Encoding.Convert? convert to byte array? decode?
chaynop
Member
2 Points
2 Posts
Re: Special characters not displaying correctly
Feb 08, 2012 05:45 PM|LINK
I set the webclient encoding to UTF8, which fixed my issue.
client.Encoding = System.Text.Encoding.UTF8;