Hey, ich habe mir folgende RSS Ausgabe Script zusammengebastelt:
|
Source code
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
<?
$quelle = @file('url.rss');
$data = implode ("", $quelle);
if(isUTF8($data)) $utf8 = 1;
else $utf8 = 0;
preg_match_all("|<item>(.*)</item>|Uism",$data, $items, PREG_PATTERN_ORDER);
if (count($items[1])==0) {
preg_match_all("|<item .*>(.*)</item>|Uism",$data, $items, PREG_PATTERN_ORDER);
}
for ($i=0; $i<count($items[1]); $i++) {
preg_match_all("|<title>(.*)</title>(.*)<link>(.*)</link>|Uism",$items[1][$i], $regs, PREG_PATTERN_ORDER);
if($utf8 == 1) $title = utf8_decode($regs[1][0]);
else $title = $regs[1][0];
echo "<div id=\"item\"><a href=\"".$regs[3][0]."\" target=\"_blank\">".$title."</a></div>\n";
}
function isUTF8($str) {
if ($str === mb_convert_encoding(mb_convert_encoding($str, "UTF-32", "UTF-8"), "UTF-8", "UTF-32")) {
return true;
} else {
return false;
}
}
?>
|
Aber es werden keine Umlaut wie Ö, Ä, Ü angezeigt, dafür erscheinen Fragezeichen.
Was muss ich am Script ändern, damit alles richtig angezeigt wird, auch die Umlaute?
Grüße