cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Decompression problems

From: Jonathan Wallace <jwallace_at_livetechnology.com>
Date: Fri, 17 Apr 2009 13:20:42 -0400

I'm using C++, so if you wouldn't mind, I'd love to get ahold of your
code for that... How do I use it, just tell libcurl to give it to me
compressed and decompressing it myself? I assume you don't use a null
terminated string for that seeing as compressed data can have null
characters in it. How do you handle that?

Marco Toldo wrote:
> Hi,
>
> possibly it's an encoding problem.
>
> When I began using zlib and deflate compression format I was never
> able to decompress data sent from a server (I always got "header
> check" errors too).
> Later I discovered that compressed data are usually base64 encoded.
> For this reason a frequent compression/decompression scheme is the following:
>
> deflate ----> encode Base 64 ----> Transmission ----> decode Base
> 64 ---> enflate
>
> Base64 encoding is described here: http://www.faqs.org/rfcs/rfc3548.html
>
> JDK from Sun has built-in classes to encode/decode base64 in Java.
> As I needed them for C/C++ (which doesn't provide them) I wrote them on my own.
>
> If you need them feel free to ask me.
>
> Regards,
>
> Marco
>
Received on 2009-04-17