Dalsze poprawki błędów związanych z kodowaniem znaków na stronach programu telewizyjnego WP.pl
 
	
	
	
	
	
	
	
	
	
	
	
	
	
 |  |  | 
 |  |  | ); | 
 |  |  | $NUMOF = count($stations); | 
 |  |  |  | 
 |  |  | ini_set('mbstring.substitute_character', 'none'); | 
 |  |  |  | 
 |  |  | $c = curl_init(); | 
 |  |  | $out = fopen('./xmltv-pre.xml', 'w'); | 
 |  |  | fwrite($out, '<?xml version="1.0" encoding="UTF-8" ?> | 
 |  |  | 
 |  |  |             return; | 
 |  |  |         } | 
 |  |  |          | 
 |  |  |         $data = mb_convert_encoding($data, 'UTF-8', 'UTF-8'); | 
 |  |  |         file_put_contents('./cache/'.$num.'_'.$date, $data); | 
 |  |  |         unset($data); | 
 |  |  |     } | 
 |  |  |      | 
 |  |  |     $doc = new DOMDocument; | 
 |  |  |     $doc = new DOMDocument('1.0', 'utf-8'); | 
 |  |  |     @$doc->loadHTMLFile('./cache/'.$num.'_'.$date); | 
 |  |  |      | 
 |  |  |     $wp = new wp_parse($doc); | 
 
 |  |  | 
 |  |  |     function xmltv($id, $fp) { | 
 |  |  |         $program = array(); | 
 |  |  |          | 
 |  |  |         ini_set('mbstring.substitute_character', 'none'); | 
 |  |  | 		 | 
 |  |  |         $days_dom = $this->xpath->query('.//ul[@class="lsDay"]//li', $this->context); | 
 |  |  |         $days = array(); | 
 |  |  |         foreach($days_dom as $day) { | 
 |  |  | 
 |  |  |                      | 
 |  |  |                     $program[$num][] = array( | 
 |  |  |                         $godzina, | 
 |  |  |                         mb_convert_encoding($nazwa, 'UTF-8', 'UTF-8'), | 
 |  |  |                         mb_convert_encoding($opis, 'UTF-8', 'UTF-8') | 
 |  |  |                         $nazwa, | 
 |  |  |                         $opis | 
 |  |  |                     ); | 
 |  |  |                 } | 
 |  |  |                 unset($programs_dom, $programs); |