Encodes some text with a WebTML encoding
This is the TMLScript pendant of WebTML attribute encode. You can use all encodings that are available to the current OpenWGA runtime and are also usable on the attribute.
For backward compatibility there still is a method "encode()" available on TMLContext whose use is discouraged since OpenWGA 5.3.
encoding (String): Name of the encoding, f.e. "html", "rtf"
input (String): The text to encode
The encoded text (String)
|Allowed in script types||
Encoding plain text to HTML in TMLScript:
encodedText = WGA.encode("html", "This text is to be \n HTML-encoded !");
The encoding will convert the line feed to a HTML linebreak tag:
This text is to be <br> HTML-encoded !