Vely logo Empower C
install  tutorials  examples
documentation  license  about

12.1.0 released on Sep 19, 2022

encode-url



PURPOSE:


URL-encode string.

SYNTAX:


encode-url <string> to [ define ] <encoded string> \
    [ output-length [ define ] <encoded length> ] \
    [ input-length <length> ]


DESCRIPTION:


encode-url URL-encodes <string> and stores the result in <encoded string> which may be created with optional "define". Number <length> in the optional "input-length" clause lets you specify the number of bytes in <string> that will be encoded - if not specified or negative, it is the string length. "output-length" clause (also optional) lets you get the length of the encoded string in <encoded length>, which can be created with optional "define".

All bytes except alphanumeric and those from "-._~" (i.e. dash, dot, underscore and tilde) are encoded.

EXAMPLES:


In this example, a string "str" is URL encoded and the result is in a "result" string variable, and its length is in "len_of_result" variable:
char str[]="  x=y?z&  ";
encode-url str to define result output-length define len_of_result

The "result" is "%20%20x%3Dy%3Fz%26%20%20" and "len_of_result" is 24.

SEE ALSO:


URL encoding ( decode-url   encode-url  )  SEE ALL (documentation)



Copyright (c) 2022 DaSoftver LLC. Vely is a trademark of Dasoftver LLC. The software and information herein are provided "AS IS" and without any warranties or guarantees of any kind. Icons copyright PaweĊ‚ Kuna licensed under MIT. This web page is licensed under CC-BY-SA-4.0.