u

Welcome to our newly overhauled Zephyr pages! See our new Overview, Examples, and Index.
Feedback is welcome at bottom of each page.

Description

Returns a URL-encoded version of a string.

 string u( string input )

This is useful when passing a query string parameter as part of a link.

If there is any possibility that a parameter value might contain special characters such as spaces, you should use the u( ) function on that parameter.

Example

 http://www.mysite.com?username={u(username)}&name={u(name)}



URL-Encode a Value

Use Case: If you need to pass any information, such as a user name, in a URL as a query string parameter. To prevent the link breaking, always use u() which allows you to URL-encode special characters. For example, the user name value “Sailthru User” would become “Sailthru%20User”

Zephyr: http://example.com?username={u(userName)}

Output: http://example.com?username=Sailthru%20User

Explanation: This script uses the u() function to add URL-encoding to a query parameter. In this instance, the space between “Sailthru” and “User” is being converted to the ASCII “%20″.

Top