www.beck-ipc.com

@CHIP-RTOS C Library - Common Gateway Interface API


CGI_UrlDecode

Decodes a URL string

void CGI_UrlDecode ( char far *dst,
                      const char far *src );

Parameters

dst

Output Parameter: Pointer to the buffer the decoded string is to be stored in; must be large enough.

src

URL-encoded string that is to be decoded

Comments

In URL-encoded strings all non-alphanumerical characters except '-', '_' and '.' are encoded as a hexadecimal value preceded by a percent sign (e.g. %26 for the ampersand). The space character is replaced by a plus sign. The text "Test 123 .&%" (without the quotes) would be encoded as "Test+123+.%26%25".
This kind of encoding is for example used to pass arguments to a CGI page with the URL.

You can pass the same pointer as src and dst parameter. The encoded string will in this case be overwritten with the decoded string.
Example:
CGI_UrlDecode(url, url);

See Also

Supported since or modified in @CHIP-RTOS version

    SC12SC13SC11SC1x3SC2x
    V1.00V1.00V1.00V0.90V1.00

Supported by @CHIP-RTOS C Library since version

    CLIB
    V2.12

This API List
List of C Libraries
@CHIP-RTOS Main Index


End of document