Download a web page to utf8.
When I download a web page with QHttp the page downloaded is not in utf8. How can I convert the page in utf8?
This is my code:
Code:
htmlFile
= new QFile("downl.html");
QUrl url
( "http://images.google.it/images" );
http->setHost(url.host(),url.port() != -1 ? url.port() : 80);
http->get(url.path() +"?q=test&gbv=2&hl=it&sa=G&imgsz=small|medium|large|xlarge", htmlFile);
Re: Download a web page to utf8.
You should try setting the "Accept-Charset" request header to "Accept-Charset=ISO-8859-1,utf-8;q=0.7,*;q=0.7".
Re: Download a web page to utf8.
Thanks but I'm new with QHttp. Can you post an example?