As i understand by default loadHTML loads in Latin 1 something and i want to convert this into UTF-8 chars. The code is the following:
    // get data from website
    function get_url_contents($url){
            $crl = curl_init();
            $timeout = 5;
            curl_setopt ($crl, CURLOPT_ENCODING, 'UTF-8');
            curl_setopt ($crl, CURLOPT_URL,$url);
            curl_setopt ($crl, CURLOPT_RETURNTRANSFER, 1);        
            curl_setopt ($crl, CURLOPT_CONNECTTIMEOUT, $timeout);
            $ret = curl_exec($crl);
            curl_close($crl);
            return $ret;
    }
// Now here is the domdoc
function get_all_meta_tags($html){
    $html = get_url_contents($html);
    $doc = new DOMDocument('1.0', 'UTF-8');
    $doc->encoding = 'UTF-8';
    $nodes = $doc->getElementsByTagName('title');
    $title = $nodes->item(0)->nodeValue;
    $arr['title']=$title;
    $nodes = $doc->getElementsByTagName('h1');
    $h1 = $nodes->item(0)->nodeValue;
    $arr['h1']=$h1;
    $metas = $doc->getElementsByTagName('meta');
for ($i = 0; $i < $metas->length; $i++)
{
$mt = $metas->item($i);
if($mt->getAttribute('name')=='description')
$dec=$mt->getAttribute('content');$arr['description']=$dec;
if($mt->getAttribute('name')=='keywords')
$key=$mt->getAttribute('content');$arr['keywords']=$key;
}
return $arr;
}
Now as you can see im grabing data from webpages and the problem is that the word do not convert into UTF-8. For example "Az utolsó dal" needs to bee "Az utolsó dal". Can somebody direct me the the problem or solution?