HTML encoder

Philippe Demaecker <[email protected]>
Newsgroups gmane.comp.lang.smalltalk.vwnc
Message-ID <AM9PR05MB87199AE0EB0BEB587D7750D887529@AM9PR05MB8719.eurprd05.prod.outlook.com>
Hi list,

I'm looking for a piece of code that will convert a string to its HTML encoded equivalent.

Input: <script>alert(1)</script>
Ouput: &lt;script&gt;alert&lpar;1&rpar;&lt;&sol;script&gt;

(Or: https://urldefense.com/v3/__https://gchq.github.io/CyberChef/*recipe=To_HTML_Entity(false,'Named*20entities')&input=PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg__;IyU!!DZ3fjg!u449TzBNRX-iDgMuIVq_ZiHgLMU3o2OLQSszE_VyPPrTzx72g5mbpe0JIfRqtNoq2fr3ME0$ )

I searched the code and list, but no luck.

Any ideas?

Thanks,
Phil
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.