gnurl_escape(3)
π GNURL_ESCAPE(3) π
okay so bestie, welcome to the libgnurl manual β we're talking about gnurl_escape(3) today and honestly? she's a legacy icon but she's also very much on her way out. let's get into it π
β¨ NAME β¨
curl_escape β URL-encodes the given string π¦
πΈ SYNOPSIS πΈ
#include <gnurl/curl.h>
char *curl_escape( const char *url, int length );
π DESCRIPTION π
okay so first thing, and I need you to hear me on this: this function is obsolete. like, retired. use curl_easy_escape(3) instead! π«Ά that's the whole vibe.
So what does she even do? This function converts the given input string into an URL encoded string and hands it back to you as a new allocated string. Cute, right?
And the encoding rule? Listen β every single input character that is not a-z, A-Z, or 0-9 gets converted to its "URL escaped" version, which looks like %NN where NN is a two-digit hexadecimal number. slay π
Now, about that length argument β if you set it to 0, then curl_escape() will just run strlen() on the input url string to figure out the size for you. convenient β¨
β οΈ bestie please do NOT forget: you must curl_free(3) the returned string when you're done with it. no cap, that memory is yours to clean up π§
π AVAILABILITY π
Since 7.15.4, you should be using curl_easy_escape(3). This function will be removed in a future release π so likeβ¦ plan accordingly.
β RETURN VALUE β
A pointer to a null-terminated string β or NULL if it failed. that's it, that's the whole deal π
π SEE ALSO π
and that's the page!! π this lil throwback was brought to you by libcurl 7.9, dated 6 March 2002 β yeah she's vintage, we stan a historical artifact πβ¨
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms