cURL / Mailing Lists / curl-library / Single Mail

curl-library

curl_escape

From: Evan Martin <eeyem_at_u.washington.edu>
Date: Mon, 30 Jul 2001 12:34:37 -0700

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/
Received on 2001-07-30