curl_easy_escape

Syntax

#include <curl/curl.h>

char *curl_easy_escape( CURL * curl , char * url , int length );

Parameters

curl Handle to a curl session.
url Pointer to a URL-encoded string.
length Length of the string to be converted.

Return Values

A pointer to a zero-terminated string or NULL if failed.

Description

This function converts the given input string to an URL encoded string and returns that as a new allocated string. All input characters that are not a-z, A-Z, 0-9, '-', '.', '_' or '~' are converted to their "URL escaped" version (%nn, where nn is a two-digit hexadecimal number).

If the length argument is set to 0 (zero), curl_easy_escape uses strlen on the input URL to discover the size.

Use curl_free on the returned string when finished with it.

Do Not Call From

None.

See Also

HTTP Client Library (libcurl)
libcurl API Functions
libcurl Error Codes
curl_easy_unescape
curl_free
RFC 2396 (http://www.ietf.org/rfc/rfc2396.txt)

Revision History

2014/06/24 Reworked external link.
2013/09/18 Conversion
2013/05/08 Automated cleanup pass.
2012/05/04 Initial version.


CONFIDENTIAL