Ns urlencode

From AOLserver Wiki
Revision as of 18:03, 7 October 2005 by Dossy (talk | contribs) (category link fixup, formatting tweaks)
Jump to navigation Jump to search

Man page: http://aolserver.com/docs/tcl/ns_urlencode.html


NAME

ns_urlencode - Encode a string to its URL-encoded representation

SYNOPSIS

ns_urlencode ?-charset charset? data

DESCRIPTION

This command encodes a string according to the rules for URL encoding defined in RFC 1738, Uniform Resource Locators (URL) and RFC 2396, Uniform Resource Identifiers (URI): Generic Syntax. Essentially, each non-alphanumeric byte is converted to its hexadecimal representation, prepended with a percent sign.
The optional -charset charset parameter defines the character set of the encoded string. If not specified, the default is "utf-8". (Is this true? The default is whatever the server's "urlcharset" is configured to, which in the sample-config.tcl may be UTF-8 or ISO-8859-1.)

EXAMPLES

   % ns_urlencode http://www.aolserver.com/
   http%3a%2f%2fwww%2eaolserver%2ecom%2f

SEE ALSO

ns_urldecode