Newlisp url encoding, newlispurl
The newlisp standard library does not support url encoding. Therefore, you can find the following code from the dragonfly library and use it after testing.
;===============================================================================; !UTF8 Compatible URL encoding/decoding;===============================================================================(constant 'REGEX_HTTP_SPECIAL_STR (regex-comp {([^.0-9a-z]+)} 1))(constant 'REGEX_HEX_ENCODED_CHAR (regex-comp {%([0-9A-F][0-9A-F])} 1))(define (hex-encode-str str , cnvrt)(setf cnvrt(dup "%%%X" (length str)))(eval (append '(format cnvrt) (unpack (dup "b" (length str)) str))));; @syntax (utf8-urlencode <str> [<bool-everything>]);; @param str the string to encode;; @param bool-everything whether to escape the entire string or just most of the "non-ascii friendly" parts.;; <p>Use this function to safely encode data that might have foreign characters in it, or simply;; characters that should be placed into URLs:</p>;; <b>example:</b>;; <pre> (utf8-urlencode "What time is it?") => "What%20time%20is%20it%3F"</pre>(define (utf8-urlencode str everything)(if everything(hex-encode-str str)(replace REGEX_HTTP_SPECIAL_STR str (hex-encode-str $1) 0x10000)));; @syntax (utf8-urldecode <str>);; <p>Decodes a utf8-urlencoded string. Converts '+''s to spaces.</p>(define (utf8-urldecode str)(replace "+" str " ")(replace REGEX_HEX_ENCODED_CHAR str (pack "b" (int $1 nil 16)) 0x10000))