Wafl Home

Primitive Data Types Tutorial

Encoding Functions

Wafl contains three encoding string functions. All of these functions share the same type: (String -> String).

Function strEncodeHtml(s) returns string encoded for inclusion in HTML. All special characters are replaced with appropriate character sequences.

Function strEncodeSql(s) returns string encoded for usage in SQL string literals. All special characters are replaced with appropriate escape sequences.

Function strEncodeUri(s) returns string encoded for appearance in URI query values. All special characters are replaced with appropriate character sequences.

NOTE: In the following example a double

Source code:

{#
strEncodeHtml( "&<>" ),
strEncodeSql( "'quotes'" ),
strEncodeUri( "a + b = c" )
#}

Result:

{# "&amp;&lt;&gt;", "''quotes''", "a%20%2B%20b%20%3D%20c" #}

 

Table of Contents

Let's Start

Program Structure

Primitive Data Types

List

Tuple

Record

HTML

Command Line Interpreter

Using Web Servers

Syntax

Examples

Tips

The most of examples evaluates with both command line and Web server Wafl interpreters. If any example is based on specific features of an interpreter, it is explicitly annotated.