aboutsummaryrefslogtreecommitdiff
path: root/docs/libcurl/curl_easy_escape.3
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2014-11-25 14:25:02 +0100
committerDaniel Stenberg <daniel@haxx.se>2014-11-25 14:25:02 +0100
commit0beda1a388faac8277ffa975629a58587a3b5264 (patch)
treec3e5e04691c7802df35a7f5374d29d523ef18747 /docs/libcurl/curl_easy_escape.3
parent7eb7f7c32dd4eab243963b694159add04016f617 (diff)
downloadgnurl-0beda1a388faac8277ffa975629a58587a3b5264.tar.gz
gnurl-0beda1a388faac8277ffa975629a58587a3b5264.tar.bz2
gnurl-0beda1a388faac8277ffa975629a58587a3b5264.zip
curl*3: added small examples
and some minor edits
Diffstat (limited to 'docs/libcurl/curl_easy_escape.3')
-rw-r--r--docs/libcurl/curl_easy_escape.325
1 files changed, 18 insertions, 7 deletions
diff --git a/docs/libcurl/curl_easy_escape.3 b/docs/libcurl/curl_easy_escape.3
index 3a98e6fe8..7c8c658d2 100644
--- a/docs/libcurl/curl_easy_escape.3
+++ b/docs/libcurl/curl_easy_escape.3
@@ -5,7 +5,7 @@
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
-.\" * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" *
.\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms
@@ -26,13 +26,13 @@ curl_easy_escape - URL encodes the given string
.SH SYNOPSIS
.B #include <curl/curl.h>
.sp
-.BI "char *curl_easy_escape( CURL *" curl ", char *" url ", int "length " );"
+.BI "char *curl_easy_escape( CURL *" curl ", char *" string ", int "length " );"
.ad
.SH 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).
+This function converts the given input \fBstring\fP 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 \fBlength\fP argument is set to 0 (zero), \fIcurl_easy_escape(3)\fP
uses strlen() on the input \fBurl\fP to find out the size.
@@ -42,5 +42,16 @@ You must \fIcurl_free(3)\fP the returned string when you're done with it.
Added in 7.15.4 and replaces the old \fIcurl_escape(3)\fP function.
.SH RETURN VALUE
A pointer to a zero terminated string or NULL if it failed.
+.SH EXAMPLE
+.nf
+CURL *curl = curl_easy_init();
+if(curl) {
+ char *output = curl_easy_escape(curl, "data to convert", 15);
+ if(output) {
+ printf("Encoded: %s\n", output);
+ curl_free(output);
+ }
+}}
+.fi
.SH "SEE ALSO"
-.BR curl_easy_unescape "(3), " curl_free "(3), " RFC 2396
+.BR curl_easy_unescape "(3), " curl_free "(3), " RFC 3986