#1 2021-05-01 16:31:23

radexpol
Member
From: Poland, Krk
Registered: 2019-11-29
Posts: 116

HTML character entities decode

Can I find a method that converts the html character entities to normal text?

Something like: result := HtmlEncode('"Me&You"&');  -> "Me&You"&

Offline

#2 2021-05-01 17:14:32

tbo
Member
Registered: 2015-04-20
Posts: 353

Re: HTML character entities decode

In the JVcl you can find something like this in the unit JvStrToHtml.

With best regards
Thomas

Offline

#3 2021-05-01 17:33:24

radexpol
Member
From: Poland, Krk
Registered: 2019-11-29
Posts: 116

Re: HTML character entities decode

Does not work for hex encoded characters for example "

Offline

#4 2021-05-02 00:53:12

Vitaly
Member
From: UAE
Registered: 2017-01-31
Posts: 168
Website

Re: HTML character entities decode

radexpol wrote:

Does not work for hex encoded characters for example "

I used SynCommons.HexToChar in my custom SynCommons.TTextWriter as a part of XML unescape add-method.

Also THTMLEncoding.DoDecode might help: http://docwiki.embarcadero.com/Librarie … MLEncoding (haven't tried it myself though)

Last edited by Vitaly (2021-05-02 00:55:36)

Offline

Board footer

Powered by FluxBB