Helma logo
helma.org » Home > Stories > encode()

encode()

Prepares a string for smooth HTML output.

Encodes a string by replacing linebreaks with <br /> tags and diacritical characters as well as HTML tags with their equivalent HTML entities.

Syntax
encode(String)

Example
var str = encode("<b>Bananer växer\n minsann inte på träd.<b>");
res.write(str);
&lt;b&gt;Bananer v&auml;xer
<br /> &lt;br&gt; minsann inte p&aring; tr&auml;d.&lt;/b&gt;


... comment


Page last modified on 2002-07-16 11:53 by tobi