Package: curl Version: 7.19.5-1 Severity: normal Hello.
cURL doesn't support application/x-www-form-urlencoded encoding, and this is stated explicitly nowhere in the documentation, thus causing much confustion As per http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1, application/x-www-form-urlencoded encoding differs from one described in RFC1738, and is performed as follows: 1. Control names and values are escaped. Space characters are replaced by `+', and then reserved characters are escaped as described in RFC1738, section 2.2: Non-alphanumeric characters are replaced by `%HH', a percent sign and two hexadecimal digits representing the ASCII code of the character. Line breaks are represented as "CR LF" pairs (i.e., `%0D%0A'). 2. The control names/values are listed in the order they appear in the document. The name is separated from the value by `=' and name/value pairs are separated from each other by `&'. This is not supported by cURL, so should be stated explicitly. Function should be implemented that performs the conversion. Or, corresponding fixes need to be made to curl_escape/curl_unescape. Maybe, an option can be made to switch between the modes. -- WBR, Andrew -- System Information: Debian Release: 5.0 APT prefers sid APT policy: (500, 'sid'), (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental') Architecture: i386 (i686) Kernel: Linux 2.6.26-1-686 (SMP w/1 CPU core) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages curl depends on: ii libc6 2.10.1-7 GNU C Library: Shared libraries ii libcurl3 7.19.7-1 Multi-protocol file transfer libra ii zlib1g 1:1.2.3.3.dfsg-14 compression library - runtime curl recommends no packages. curl suggests no packages. -- no debconf information
/* curl-test.c */ /* Compile with `make curl-test LOADLIBES=-lcurl` */ #include <stdio.h> #include <curl/curl.h> int main() { char test[] = "http://en.wikipedia.org/w/index.php?title=Curl+(disambiguation)&action=view"; char * decoded = curl_unescape(test, 0); printf("original:\n%s\nunescaped:\n%s\n", test, decoded); curl_free(decoded); return 0; }