c# 4.0 wpf html decode is not correctly decoding special characters - System.Net.WebUtility.HtmlDecode

StackOverflow https://stackoverflow.com/questions/7883457

Frage

The text i am trying to decode Anasayfa > OEM Ürünleri > Ekran Kartları > SAPPHIRE

Alright this is how i am trying

 string srCategory = System.Net.WebUtility.HtmlDecode(nodeCategory.InnerText.ToString()).ToString().Trim();

The result: Anasayfa > OEM �r�nleri > Ekran Kartlar� > SAPPHIRE

So why it is not working ? thank you.

c# 4.0 wpf application

War es hilfreich?

Lösung

This works for me. This is correct, no?

string srCategory = System.Net.WebUtility.HtmlDecode("Anasayfa > OEM Ürünleri > Ekran Kartları > SAPPHIRE").ToString().Trim();

My current culture is EN-US, whats yours, I can try to duplicate and update here although I really don't think that matters here at all.

Are you certain its just not a display issue in whatever you are trying to display? Its not an encoded character so it shouldn't change upon decode.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top