Ask Curl collect ebay garbled how to solve?
Dear friends, I now use curl to collect information, found that the collection of ebay store information is always displayed as garbled, such as:
$url = "http://stores.ebay.com/sportingamerica/";
$caiji =curl_get_contents ($url);
Print_r ($caiji);
Can any of the friends explain? Thank you!
Encoding should be no problem, my php file encoding is Utf-8,ebay page encoding is also utf-8 AH.
------to solve the idea----------------------
Data was compressed by gzip
Set this curl_setopt ($ch, curlopt_encoding, 1);
Or read back after Echo Gzdecode ($caiji);
------to solve the idea----------------------
You can set the return code after getting the encoding format to TEXT/UTF8 format, so see if it is possible.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.