0

I am doing a web request for a Portuguese web page. After I get the result, I see the some of the characters are getting converted to hash format.

Example:

Source: PRAÇA DOS OMAGUÁS

Result I am getting : PRAÇA DOS OMAGUÁS

I tired set the encoding format to "IBM860" (reference: http://msdn.microsoft.com/en-us/library/system.text.encodinginfo.getencoding.aspx) for webrequest. But it is still not able to convert.

Any ideas?

Naveen
  • 315
  • 2
  • 4
  • 15

2 Answers2

2
string s = System.Web.HttpUtility.HtmlDecode("PRAÇA DOS OMAGUÁS");
L.B
  • 114,136
  • 19
  • 178
  • 224
1
> HttpUtility.HtmlDecode("PRAÇA DOS OMAGUÁS")

You can use HttpUtility.HtmlDecode

If you are using .NET 4.0+ you can also use WebUtility.HtmlDecode which does not require an extra assembly reference as it is available in the System.Net namespace

How can I decode HTML characters in C#?

Community
  • 1
  • 1
mastermind
  • 1,057
  • 1
  • 8
  • 15