Function Repository Resource:

DecodeHTMLCharacterEntities

Source Notebook

Decode HTML character entities in a string with their regular Unicode characters

Contributed by: Arnoud Buzing

ResourceFunction["DecodeHTMLCharacterEntities"][string]

decodes the HTML character entities in the given string.

Details

ResourceFunction["DecodeHTMLCharacterEntities"] uses Python with the html library.

Examples

Basic Examples (1) 

Replace HTML character entities with Unicode characters:

In[1]:=
ResourceFunction[
 "DecodeHTMLCharacterEntities", ResourceSystemBase -> "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"]["a < b"]
Out[1]=
In[2]:=
ResourceFunction[
 "DecodeHTMLCharacterEntities", ResourceSystemBase -> "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"]["€500"]
Out[2]=
In[3]:=
ResourceFunction[
 "DecodeHTMLCharacterEntities", ResourceSystemBase -> "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"]["Limit[1/x,x->∞]"]
Out[3]=

Possible Issues (1) 

This function expects expects one argument and it must be a string. Anything else will give a Failure:

In[4]:=
ResourceFunction[
 "DecodeHTMLCharacterEntities", ResourceSystemBase -> "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"][42, "s"]
Out[4]=

Publisher

Arnoud Buzing

Requirements

Wolfram Language 13.0 (December 2021) or above

Version History

  • 1.0.1 – 22 October 2024
  • 1.0.0 – 06 September 2024

License Information