2

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

animuson
  • 53,861
  • 28
  • 137
  • 147
Furkan Gözükara
  • 22,964
  • 77
  • 205
  • 342

1 Answers1

3

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.

Adam Tuliper
  • 29,982
  • 4
  • 53
  • 71
  • no when i assign the value to the label still incorrect. the text page is this : http://www.vatanbilgisayar.com/Ekran%20Kart%C4%B1/sapphire-11167-02-20r-hd5570-gddr3-1gb-128bit-ati-dx11-ekran-karti-%2811167-02-20r%29/productdetails.aspx?I_ID=43725 . i am using htmlagilitypack to download and select the category title. – Furkan Gözükara Oct 25 '11 at 00:58
  • i even tried this but still problematic : StreamReader reader = new StreamReader(WebRequest.Create(textBox1.Text).GetResponse().GetResponseStream(), Encoding.UTF8); //put your encoding – Furkan Gözükara Oct 25 '11 at 01:06
  • setting encoding to iso iso-8859-9 fixed. – Furkan Gözükara Oct 25 '11 at 01:11