NaviServer - programmable web server


[ Main Table Of Contents | Table Of Contents | Keyword Index ]

ns_urlencode(n) 4.99.3 naviserver "NaviServer Built-in Commands"

Name

ns_urlencode - Encode a string to its URL-encoded representation

Table Of Contents

Synopsis

Description

This command encodes a string according to the rules for URL encoding defined in RFC #1738, Uniform Resource Locators. ns_urlencode codes all non-alphanumeric characters in data. The encoding for a character is a "%" followed by the two-character hexa- decimal representation for the character. urlencoding the string: http://www.aolserver.com/redirect.adp?url=http://www.aol.com&t=1,2,3 yields the string: http%3a%2f%2fwww%2eaolserver%2ecom%2fredirect%2eadp%3furl%3dhttp%3a%2f%2fwww%2eaol%2ecom%26t%3d1%2c2%2c3

COMMANDS

ns_urlencode -charset charset data

EXAMPLES

  set link [ns_urlencode http://www.aolserver.com/redirect.adp?url=http://www.aol.com&t=1,2,3]
  ns_adp_puts "<a href=[ns_urlencode [set link]]>click</a>"

See Also

nsd

Keywords

ns_urldecode