2

I use this code:

 Dim str= Web.HttpUtility.HtmlDecode("'")

But it not working. Result : str="'"

D T
  • 3,522
  • 7
  • 45
  • 89
  • Your code does convert this on my machine...Have you added System.Web as a reference in Visual Studio? – Dustin Jun 01 '16 at 10:20

1 Answers1

3

" is on the official list of valid HTML 4 entities, but ' is not.

https://stackoverflow.com/a/2083770/831138

So you should probably do a correction (yourString.Replace("'",""")) before the Decode.

Community
  • 1
  • 1
Xavier Peña
  • 7,399
  • 9
  • 57
  • 99
  • Only this character "'", or exist other character have to replace? – D T Jun 01 '16 at 10:27
  • @DT All those that are not present in the specification, I presume: https://www.w3.org/TR/html4/sgml/entities.html (could be any). – Xavier Peña Jun 01 '16 at 10:51