5

I read data from a mysql database that has is filled by php scripts. All special characters are converted to named or numbered html entities (for example & a m p ; & # 2 8 6 ;). I know of no way to convert these characters back to the original ones in Delphi as unicode strings. Did anyone ever find or even create such a function? This would be very helpful to me. Thanks! Marc

user133370
  • 167
  • 1
  • 5

1 Answers1

14

In Delphi 2007 there is a unit called HTTPApp.pas (in [Delphi Folder]\Source\Win32\Internet) that has the functions HTMLEncode and HTMLDecode. They might be worth a look.

Pauk
  • 2,623
  • 3
  • 26
  • 28
  • Right, this really looks interesting. I will test this unit later on, but as far as i can see this seems to solve the question. Thanks! – user133370 Jul 08 '09 at 12:15
  • `HTTPApp/HTMLDecode( )` has been deprecated. The new unit and method are `System.NetEncoding/TNetEncoding.HTML.Decode( )`. – James L. Feb 12 '23 at 03:07