cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: getinmemory.c sample crashes with TCHAR

From: Itamar Syn-Hershko <itamar_at_divrei-tora.com>
Date: Mon, 13 Nov 2006 21:35:51 +0200

>
> Libcurl reads and writes in bytes, and AFAIK there is no
> guarantee that it will always pass complete multi-byte chars
> to your callback. So I think it is much easier to use a
> single-byte index for your buffer, and typecast/convert the
> buffer to multibyte when needed.
>
> - Jeff
>
>

This is the approach I ended up using, and since I only access one ASPX on a
server, I set it to be UTF8 and am using MultiByteToWideChar with the
CP_UTF8 flag. Now it works allright (tho still crashes with wchar_t* as a
buffer). Thank you all for your help.

Itamar.
Received on 2006-11-13