STRING::UNESCAPE_HTML 1g 2024-04-26 laplante@plcb.ca GOWEB/STRING — Decode HTML Entities


title: “STRING::UNESCAPE_HTML” version: “1.0.0” date: 2024-04-26 author: “laplante@plcb.ca” section: “1g” category: “GOWEB/STRING”


Name

string::unescape_html Decode HTML Entities

Synopsis

string::unescape_html(string)
unescape_html(string)
string::unescapeHtml(string)
unescapeHtml(string)

Description

The unescape_html function decodes HTML entities into their corresponding characters. It converts sequences like &lt; into < and &eacute; into é.

This is the reverse operation of escape_html.


Examples

res={{
    unescape_html("abc"); "\n";
    unescape_html("(&eacute;)"); "\n";
    unescape_html("ABC&eacute;a"); "\n";
    unescape_html("A&abcBC&eacute;a"); "\n";
    unescape_html(" 111 TH ST. & 51ST AVENUE"); "\n";
    unescape_html("&OElig;"); "\n";
    unescape_html("&aacute; &bne;"); "\n";

    "\n";

    escape_html("abc"); "\n";
    escape_html("(é)"); "\n";
    escape_html("ABCéa"); "\n";
    escape_html("A&abcBCéa"); "\n";
    escape_html(" 111 TH ST. & 51ST AVENUE"); "\n";

    "\n";

    escape_html("ABCabcé<>\"'&"); "\n";
    escape_html(full:false, "ABCabcé<>\"'&"); "\n";

    "\n";

    unescape_html(escape_html("ABCabcé<>\"'&")); "\n";
    unescape_html(escape_html(full:false, "ABCabcé<>\"'&")); "\n";
}}.

Returns:

abc
(é)
ABCéa
A&abcBCéa
 111 TH ST. & 51ST AVENUE
Œ
á =⃥

abc
&lpar;&eacute;&rpar;
ABC&eacute;a
A&amp;abcBC&eacute;a
 111 TH ST&period; &amp; 51ST AVENUE

ABCabc&eacute;&lt;&gt;&quot;&#39;&amp;
ABCabcé&lt;&gt;&#34;&#39;&amp;

ABCabcé<>"'&
ABCabcé<>"'&

Author

laplante@plcb.ca

See Also


Version