urlencode
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
| — | urlencode [2009/08/29 23:21] (current) – created - external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | # $EPIC: urlencode.txt, | ||
| + | ======Synopsis: | ||
| + | $__urlencode__(< | ||
| + | |||
| + | ======Technical: | ||
| + | This function performs a rfc3986 transformation on < | ||
| + | The rfc3986 transformation converts all bytes into percent format, | ||
| + | except bytes with the value 0x41-0x5A (" | ||
| + | 0x2D (" | ||
| + | |||
| + | The percent format substitutes three bytes of output for each byte of | ||
| + | input. | ||
| + | equivalent of the hexadecimal value of the input. | ||
| + | |||
| + | For example, a space is converted into the three bytes 0x25 0x32 0x30, | ||
| + | (" | ||
| + | |||
| + | This conversion is popularly used to protect strange characters from | ||
| + | mishandling in http requests. | ||
| + | |||
| + | Unfortunately, | ||
| + | cannot convert binary data using this method, since the convesion will stop | ||
| + | at the first nul (ascii 0). | ||
| + | |||
| + | The [[urldecode]] function does the reverse transformation. | ||
| + | |||
| + | This function has been superceded by [[xform]] which has a URL transform. | ||
| + | |||
| + | ======Practical: | ||
| + | This can be used to mangle text passed to the /[[exec command|exec]] | ||
| + | command so that it does not contain dangerous meta-characters. | ||
| + | could also rename files sent via dcc. | ||
| + | |||
| + | ======Returns: | ||
| + | The input < | ||
| + | "url encoded" | ||
urlencode.txt · Last modified: 2009/08/29 23:21 by 127.0.0.1
