encode(encoders, input [,context])
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. Just like on the attribute you can use a comma-separated list of multiple encoders that are processed in row.
For backward compatibility there still is a method "encode()" available on TMLContext whose use is discouraged since OpenWGA 5.3.
encoding (String): Comma-separated list of encoding names, f.e. "html", "rtf"
input (String): The text to encode
context (TMLContext, optional): TMLContext to be used for the encoder if supported by the encoder.
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 !