Function Repository Resource:

EncodeHTMLCharacterEntities

Source Notebook

Encode regular Unicode characters in a string to their HTML character entities

Contributed by: Arnoud Buzing

ResourceFunction["EncodeHTMLCharacterEntities"][string]

encodes the Unicode characters in the given string to their HTML character entities.

Details

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

Examples

Basic Examples (1) 

Replace Unicode characters with their HTML character entities:

In[1]:=
ResourceFunction["EncodeHTMLCharacterEntities"]["a < b"]
Out[1]=
In[2]:=
ResourceFunction[
 "EncodeHTMLCharacterEntities"]["Limit[ 1/x, x -> \[Infinity] ]"]
Out[2]=

Possible Issues (1) 

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

In[3]:=
ResourceFunction["EncodeHTMLCharacterEntities"][42, "s"]
Out[3]=

Publisher

Arnoud Buzing

Requirements

Wolfram Language 14.0 (January 2024) or above

Version History

  • 1.0.0 – 06 September 2024

License Information