Difference between revisions of "Ns urlencode"

From AOLserver Wiki
Jump to navigation Jump to search
(imported from WiKit id 924)
 
m (category link fixup, formatting tweaks)
Line 24: Line 24:
 
'''SEE ALSO'''
 
'''SEE ALSO'''
  
: [[ns_urldecode]], [[Discussion of ns_urlencode]]
+
: [[ns_urldecode]]
  
----
+
[[Category:Documentation]]
 
+
[[Category:Core Tcl API]]
[[Category Documentation]] - [[Category Core Tcl API]]
 

Revision as of 18:03, 7 October 2005

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