Haven't written a blog for a long time, today, a whim, record a problem solved today.
After Curl set the curlopt_accept_encoding (7.21.8 before curlopt_encoding ) , according to the official saying, Is can automatically respond to the gzip compressed content decompression, but my project did not decompress, and online A search is also a large number of people ask this question, and the answer is actually said can be automatically extracted. I was bored.
The Curl library in my project was compiled by myself, I went to see the Config.log, search zlib incredibly see With-zlib is disable, then understand, download Zlib library, first compiled, and then in the Curl project configure with-with-zlib= parameters, Pit dad is, It must also go to the directory you set up to find the Include directory and then to your change file, find Lib directory and then go to find libz.a, and zlib in the library exactly no such directory structure, then build it yourself.
Then compile curl, the project set curlopt_accept_encoding to gzip, the response is sure to automatically unzip the smooth, O.
Unzip the contents of gzip using curl