2

I get a page response from a web and it is having strings like "Lluís Quílez". But i get it as "Lluís Quílez". So how do i change it back to "Lluís Quílez" in C#?

Thank you.

missingfaktor
  • 90,905
  • 62
  • 285
  • 365
NLV
  • 21,141
  • 40
  • 118
  • 183

2 Answers2

5

The string is HTML encoded. Use the HtmlDecode method:

s = System.Web.HttpUtility.HtmlDecode(s);
Guffa
  • 687,336
  • 108
  • 737
  • 1,005
2

Check out this outstanding article which might help you ;)

and an answer to a related question here.

Community
  • 1
  • 1
Tomas Vana
  • 18,317
  • 9
  • 53
  • 64
  • I don't get why I was downvoted on this.. is there something wrong with my answer ? I'm relatively new here, maybe I'm missing something.. – Tomas Vana Jan 15 '10 at 07:53
  • 1
    Don't worry about the downvotes, it happens from time to time. Sometimes people *misuse* downvotes if they don't agree with an answer. Anyway, good find of the duplicate question. – dalle Jan 15 '10 at 07:57
  • Not my downvote, but perhaps someone felt your first link to be not useful. This isn't a Unicode issue at all, really. – AakashM Jan 15 '10 at 07:58
  • Maybe you're right with the Unicode, I just thought clarifying how encodings in web work wouldn't make any harm as an addition to the solution which is just one line of code ;) Anyway, thanks for your comments. – Tomas Vana Jan 15 '10 at 08:25