- ns_urldecode - URL decoding
- ns_urldecode ?-charset charset? data
- This command decodes a string according to the rules for URL encoding defined in RFC 1738, Uniform Resource Locators (URL). 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".
% ns_urldecode http%3a%2f%2fwww%2eaolserver%2ecom%2f http://www.aolserver.com/
The character é lowercase 'e' accent is represented by the byte e9 in iso8859-1 but in utf-8 by the two bytes c3 and a9.
% ns_urldecode -charset iso8859-1 %e9 % é % ns_urldecode -charset utf-8 %c3%a9 % é
Using the wrong charset may lead to errors. If one (two byte) utf-8 character was decoded using iso8859-1 it would result in two incorrect characters.
% ns_urldecode -charset iso8859-1 %c3%a9 % Ã©