cURL / Mailing Lists / curl-library / Single Mail


Re: ebcdic and tpf patches

From: Dan Fandrich <>
Date: Tue, 14 Mar 2006 13:58:32 -0800

On Tue, Mar 14, 2006 at 09:19:43PM +0000, David McCreedy wrote:
> The patch file for the EBCDIC and TPF changes is attached
> (curl_ebcdic_patch.txt).
> Among the changes is a new file called config-tpf.h
> The only unforeseen change for curl_unescape2 was in ldap.c.
> I needed to change the prototype for unescape_elements to include the
> handle (conn->data):
> -static bool unescape_elements (LDAPURLDesc *ludp)
> +static bool unescape_elements (void *data, LDAPURLDesc *ludp)
> I think this is an internal function only.

It's static and its pointer isn't exported, so it has to be internal only.

> If not, we'll figure out how to change it without impacting existing users.
> Let me know if you have any questions or concerns.

I have a few general comments:

- As someone pointed out here recently, the hooks to do EBCDIC conversion
could also be used to do UNICODE conversion; as such, most references
to EBCDIC could be changed to something more generic.

- Is it really necessary to provide callbacks for a user-supplied conversion
routine? Can't you rely on libiconv to do the right thing and let the user
create a custom iconv conversion table if necessary?

- The lack of proper ftp ASCII conversion is a KNOWN_BUG #21. Presumably,
this patch does the right thing for EBCDIC, but can it be made to do the
right thing in the general case?

- There are several places where #ifdefs could be removed from where they are
interspersed within the core curl code and changed to supply alternate
functions depending on the platform, e.g. curl_convert_lineends() and
(a suitably renamed) Curl_convert_ascii_to_ebcdic() could be no-ops or even
macroed away on non-EBCDIC platforms, making the code easier to read.

- curl_unescape2() shouldn't take a void *; that pointer must be a
struct SessionHandle *

>>> Dan

--              The web change of address service
          Let webmasters know that your web site has moved
Received on 2006-03-14