This article details the garbled characters such as correct header filling: Is the returned data encrypted? I figured it out by myself that the returned data is compressed by gzip, and curl is normal only after being decompressed. Thank you.
Sending a post in a browser returns data normally. garbled characters are returned using php curl.
Header filled correctly
Garbled like this:
Is the returned data encrypted?
I figured it out by myself that the returned data is compressed by gzip, and curl is normal only after being decompressed. Thank you.
Reply content:
Header filled correctly
Garbled like this:
Is the returned data encrypted?
I figured it out by myself that the returned data is compressed by gzip, and curl is normal only after being decompressed. Thank you.
Use iconv to convert the returned character set to your current one.
Add a sentence to CURL:
Curl_setopt ($ ch, CURLOPT_ENCODING ,"");
For encoding problems, check the encoding used by the website you requested (such as UTF-8/gbk ).
The above is the garbled content returned by php curl normally when sending post data in a browser. For more information, see PHP Chinese website (www.php1.cn )!