Sortix nightly manual
This manual documents Sortix nightly, a development build that has not been officially released. You can instead view this document in the latest official manual.
curl_easy_unescape(3) | libcurl | curl_easy_unescape(3) |
NAME
curl_easy_unescape - URL decodes the given stringSYNOPSIS
#include <curl/curl.h>
char *curl_easy_unescape(CURL *curl, const char *input,
int inlength, int *outlength);
DESCRIPTION
This function converts the URL encoded string input to a "plain string" and returns that in an allocated memory area. All input characters that are URL encoded (%XX where XX is a two-digit hexadecimal number) are converted to their binary versions.EXAMPLE
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
int decodelen;
char *decoded = curl_easy_unescape(curl, "%63%75%72%6c", 12, &decodelen);
if(decoded) {
/* do not assume printf() works on the decoded data! */
printf("Decoded: ");
/* ... */
curl_free(decoded);
}
curl_easy_cleanup(curl);
}
}
AVAILABILITY
Added in 7.15.4 and replaces the old curl_unescape(3) function.RETURN VALUE
A pointer to a null-terminated string or NULL if it failed.SEE ALSO
curl_easy_escape(3), curl_free(3)December 4, 2023 | libcurl 8.5.0 |