开发者

delphi html decode

I'm using Delphi 2009 and want to decode an HTML encoded string, for example:

' -> '

But cannot fi开发者_C百科nd any built in function for doing this.

Thanks in advance


Look at the HTTPApp unit. HTTPDecode and HTMLDecode (as well as the Encode functions). You should find this in your Source/Win32/Internet folder.


The HttpApp.HttpDecode function doesn't decode http entities (https://www.w3.org/TR/html4/sgml/entities.html#sym)

For example: ∴

function HtmlDecode(s: UnicodeString): UnicodeString;
{ 
   Public domain: No attribution required
   Known issue, it doesn't handle entities with characters code points above $FFFF (65536)
   e.g.: &
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜