cURL / Mailing Lists / curl-library / Single Mail


Re: feedback needed on curl_escape and curl_unescape changes

From: Daniel Stenberg <>
Date: Tue, 14 Mar 2006 00:30:32 +0100 (CET)

On Mon, 13 Mar 2006, David McCreedy wrote:

> A more elegant solution might be to rename the functions to something like
> curl_[un]escape2 and use a #define in curl.h to make the change transparent
> to existing callers outside of libcurl:
> #define curl_escape(a, b) curl_escape2((void *)0, a, b)
> #define curl_unescape(a, b) curl_unescape2((void *)0, a, b)
> That will allow libcurl to call the new API without any #ifdefs:
> conn->proxyuser = curl_unescape2(data,proxyuser,0);
> And curl_[un]escape2 can be added to the API docs with the note that EBCDIC
> platforms need to use it instead of curl_[un]escape.

I think the approach is fine. I do however think that we should instead favour
the use of the *2() versions for all platforms and simply deprecate the
current versions, instead of simply mention it for EBCDIC use. The define
trick will just make it simpler for all to recompile older programs (and
examples) to use the new ones "automatically".

It makes life simpler if we have and propagate a single set of functions to
use for escaping/unescaping.

(I'm applying your OpenSSL and FTP related changes just now.)

  Commercial curl and libcurl Technical Support:
Received on 2006-03-14