gnurl_escape(3)

πŸ“¦ version 7.72.0, in nixos 26.05, nixpkgs unstable

πŸ’… 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