c# 4.0 wpf html decode is not correctly decoding special characters - System.Net.WebUtility.HtmlDecode
-
11-02-2021 - |
質問
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
解決
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.
所属していません StackOverflow