The Little Guy Posted February 9, 2009 Share Posted February 9, 2009 I am using cURL to get the title of a page (if there is one). Some sites, such as http://aria.ru/ are not in English, so I think my php doesn't know what to do with the text, so it is giving symbols back to me. I do believe that the "Arial" font does support this language, because in "Notepad" it displays the text just fine in "Arial". $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $_POST['s']); curl_setopt($ch, CURLOPT_HEADER, FALSE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_BINARYTRANSFER, TRUE); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); $opt = curl_exec($ch); curl_close($ch); echo $opt; Does anyone know why the text shows as symbols, and how I can fix it? Quote Link to comment https://forums.phpfreaks.com/topic/144541-curl-output-font/ Share on other sites More sharing options...
premiso Posted February 9, 2009 Share Posted February 9, 2009 Most likely the issue is the Charset. I am not sure what charset you are displaying your page in, maybe try using the charset from that page or UTF8. Quote Link to comment https://forums.phpfreaks.com/topic/144541-curl-output-font/#findComment-758483 Share on other sites More sharing options...
The Little Guy Posted February 9, 2009 Author Share Posted February 9, 2009 They have this: <meta http-equiv="Content-Type" content="text/html; charset=windows-1251"> So.. I copied and pasted it, and it still displayed symbols. Quote Link to comment https://forums.phpfreaks.com/topic/144541-curl-output-font/#findComment-758496 Share on other sites More sharing options...
The Little Guy Posted February 9, 2009 Author Share Posted February 9, 2009 I just added this to my curl: $headers = array('Content-type: text/html; charset=windows-1251'); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); And still no luck Quote Link to comment https://forums.phpfreaks.com/topic/144541-curl-output-font/#findComment-758504 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.