cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: sending non-ascii via libcurl POST

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Tue, 17 Aug 2004 13:13:14 +0200 (CEST)

On Tue, 17 Aug 2004, nkb wrote:

> When I POST to my webserver, I could get reply successfully only if the POST
> content is ascii. If I inlcude in my content some Unicode characters, I
> would not get the correct reply. So, I'm wondering how do I set libcurl (or
> should I convert my string? If so, how?)

You should send the data the way the server wants it. I cannot tell you what
your server expects. libcurl does no conversions or translations.

I suspect that you send data that contains zeroes, and then you must use
CURLOPT_POSTFIELDSIZE and not rely on libcurl doing strlen() on the data to
figure out the size of it.

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2004-08-17