cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: curl_escape

From: Drash, Jim [EESUS] <JDrash_at_EESUS.JNJ.com>
Date: Tue, 31 Jul 2001 08:32:50 -0400

The you have to encode the %

> -----Original Message-----
> From: Evan Martin [mailto:eeyem_at_u.washington.edu]
> Sent: Monday, July 30, 2001 3:35 PM
> To: curl-library_at_lists.sourceforge.net
> Subject: curl_escape
>
>
> I recently received a bug report about my program being able to handle
> sending %20 characters properly.
>
> I traced it down to this bit in escape.c:
>
> (function: curl_escape())
> /* encode it */
> if(('%' == in) &&
> (length>=2) &&
> isxdigit((int)string[1]) &&
> isxdigit((int)string[2]) ) {
> /*
> * This is an already encoded letter, leave it!
> */
> memcpy(&ns[index], string, 3);
> string+=2;
> }
>
> This behavior seems incorrect to me.
>
> Suppose I'm posting a form where I want to include a literal "%20" (or
> any other form of % followed by two hex digits): If I simply pass the
> data through curl_escape, it won't be encoded properly.
>
> For my client, I'm now using my own URL encoding routines.
> I suggest:
>
> - Remove this block of code,
> or
> - Document this behavior.
>
> --
> Evan Martin - martine_at_speakeasy.net
> http://www.speakeasy.org/~martine
>
> _______________________________________________
> Curl-library mailing list
> http://curl.haxx.se/libcurl/
>

_______________________________________________
Curl-library mailing list
http://curl.haxx.se/libcurl/
Received on 2001-07-31