Is there some functionality in/for Delphi that converts a string with html named and numbered entities to unicode text?

六眼飞鱼酱① 提交于 2020-01-01 11:26:49

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/1097163/is-there-some-functionality-in-for-delphi-that-converts-a-string-with-html-named

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!