http://onionworks.net/2004/renderengine/web

urlEncode (text : string) : string

The method “urlEncode” changes a character string into a valid URL. In doing so, special characters are replaced with appropriate hexadecimal values.

<xsl:variable name="url">
<xsl:value-of select="c.literalUri('default', 'lang', 'de')" />
</xsl:variable>
<xsl:value-of select="$url" />
<br />
<xsl:value-of select="web:urlEncode($url)" />

The output of the example looks as follows: 

/myOnionApplication/page.ashx/lang=de/1
%2fmyOnionApplication%2fpage.ashx%2flang%3dde%2f1

The first output is a URL without the use of urlEncode. Unlike the second output, where all special characters are replaced.