mam mały problem z kodowaniem znaków... chodzi o to że na stronę wczytuję ostatnie tematy na forum wraz z linkami, problem tkwi w tym że plik generujący pobiera dane z bazy danych która ma kodowanie utf-8, a na stronie mam iso-8859-1 co powoduje wykrzaczanie liter z ogonkami

skrypt generujący "ostatnie tematy na forum":
Kod
<?php
// USTAWIENIA
// (t) ilość wyświetlanych tematów
$default_tps_number = 10;
// (w) długość tytułów
$default_tps_title_width = 60;
// (s) miejsce, w jakim zostanie otwarty temat; topic - początek tematu, post - ostatni post
$default_tps_show = 'post';
// (p) miejsce wyświetlania tematu
$default_tps_display_place = '_blank';
// (a) pokazuje liczbe odpowiedzi; 1 - tak, 0 - nie
$default_show_answers = 1;
// (u) pokazuje autora postu; 2 - ostatniego, 1 - pierwszego, 0 - nie pokazuje autora
$default_show_posters = 2;
// (f) pokazuje nazwę forum, w którym znajduję się temat; 1 - tak, 0 - nie
$default_show_forumname = 0;
$adres_forum = 'http://forum.ogar200.pl';
// adres forum bez końcowego "/", z "http://" na początku
// KONIEC USTAWIEN
if($_GET['t']) { $t = $_GET['t']; } else { $t = $default_tps_number; }
if($_GET['w']) { $w = $_GET['w']; } else { $w = $default_tps_title_width; }
if($_GET['s']) { $s = $_GET['s']; } else { $s = $default_tps_show; }
if($_GET['p']) { $p = $_GET['p']; } else { $p = $default_tps_display_place; }
if($_GET['a']) { $a = $_GET['a']; } else { $a = $default_show_answers; }
if($_GET['u']) { $u = $_GET['u']; } else { $u = $default_show_posters; }
if($_GET['f']) { $f = $_GET['f']; } else { $f = $default_show_forumname; }
include 'config.php';
if(!$db = mysql_connect($dbhost, $dbuser, $dbpasswd)) {
echo '<b>Błąd!</b><br />Nie można połączyć się z bazą!';
}
if(!mysql_select_db($dbname, $db)) {
echo '<b>Błąd!</b><br />Nie można wybrać bazy danych!';
}
$result = mysql_query("SELECT * FROM `". $table_prefix ."topics` WHERE forum_id ORDER BY `topic_last_post_id` DESC LIMIT 0 , ". $t);
while($row = mysql_fetch_array($result))
{
$out_title = '<a href="'. $adres_forum .'/viewtopic.php?f='. $row['forum_id'] .'&t='. $row['topic_id'] .'" target="'. $p .'">' .$row['topic_title']. '</a><br>';
if( $f ) {
$result_forum = mysql_query("SELECT `forum_name` FROM `". $table_prefix ."forums` WHERE `forum_id` = '". $row['forum_id'] ."'");
$row['forum_name'] = mysql_result($result_forum, 0);
$out_forum = '[<a href="'. $adres_forum .'/viewforum.php?f='. $row['forum_id'] .'" target="'. $p .'">'. $row['forum_name'] .'</a>] ';
}
if( $a ) {
$out_answers = ' <font size=1 color="#FF9900" face="Tahoma">(<b>'. $row['topic_replies'] .'</b>) odpowiedzi</font>';
}
if( $u ) {
switch($u) {
case 2:
$poster[0] = $row['topic_last_poster_id'];
$poster[1] = $row['topic_last_poster_name'];
break;
case 1:
$poster[0] = $row['topic_poster'];
$poster[1] = $row['topic_first_poster_name'];
break;
}
$out_poster = '<br><font size=1 color="#FF9900" face="Tahoma">ostatnia przez: <a href="'. $adres_forum .'/memberlist.php?mode=viewprofile&u='. $poster[0] .'" target="'. $p .'">'. $poster[1] .'</a></font><br>';
}
if(strlen($row['topic_title']) > $w) { $row['topic_title'] = substr($row['topic_title'], 0, $w); }
$output .= $out_forum . $out_title . $out_answers . $out_poster .'<br/>';
}
echo $output;
mysql_close($db);
?>
// USTAWIENIA
// (t) ilość wyświetlanych tematów
$default_tps_number = 10;
// (w) długość tytułów
$default_tps_title_width = 60;
// (s) miejsce, w jakim zostanie otwarty temat; topic - początek tematu, post - ostatni post
$default_tps_show = 'post';
// (p) miejsce wyświetlania tematu
$default_tps_display_place = '_blank';
// (a) pokazuje liczbe odpowiedzi; 1 - tak, 0 - nie
$default_show_answers = 1;
// (u) pokazuje autora postu; 2 - ostatniego, 1 - pierwszego, 0 - nie pokazuje autora
$default_show_posters = 2;
// (f) pokazuje nazwę forum, w którym znajduję się temat; 1 - tak, 0 - nie
$default_show_forumname = 0;
$adres_forum = 'http://forum.ogar200.pl';
// adres forum bez końcowego "/", z "http://" na początku
// KONIEC USTAWIEN
if($_GET['t']) { $t = $_GET['t']; } else { $t = $default_tps_number; }
if($_GET['w']) { $w = $_GET['w']; } else { $w = $default_tps_title_width; }
if($_GET['s']) { $s = $_GET['s']; } else { $s = $default_tps_show; }
if($_GET['p']) { $p = $_GET['p']; } else { $p = $default_tps_display_place; }
if($_GET['a']) { $a = $_GET['a']; } else { $a = $default_show_answers; }
if($_GET['u']) { $u = $_GET['u']; } else { $u = $default_show_posters; }
if($_GET['f']) { $f = $_GET['f']; } else { $f = $default_show_forumname; }
include 'config.php';
if(!$db = mysql_connect($dbhost, $dbuser, $dbpasswd)) {
echo '<b>Błąd!</b><br />Nie można połączyć się z bazą!';
}
if(!mysql_select_db($dbname, $db)) {
echo '<b>Błąd!</b><br />Nie można wybrać bazy danych!';
}
$result = mysql_query("SELECT * FROM `". $table_prefix ."topics` WHERE forum_id ORDER BY `topic_last_post_id` DESC LIMIT 0 , ". $t);
while($row = mysql_fetch_array($result))
{
$out_title = '<a href="'. $adres_forum .'/viewtopic.php?f='. $row['forum_id'] .'&t='. $row['topic_id'] .'" target="'. $p .'">' .$row['topic_title']. '</a><br>';
if( $f ) {
$result_forum = mysql_query("SELECT `forum_name` FROM `". $table_prefix ."forums` WHERE `forum_id` = '". $row['forum_id'] ."'");
$row['forum_name'] = mysql_result($result_forum, 0);
$out_forum = '[<a href="'. $adres_forum .'/viewforum.php?f='. $row['forum_id'] .'" target="'. $p .'">'. $row['forum_name'] .'</a>] ';
}
if( $a ) {
$out_answers = ' <font size=1 color="#FF9900" face="Tahoma">(<b>'. $row['topic_replies'] .'</b>) odpowiedzi</font>';
}
if( $u ) {
switch($u) {
case 2:
$poster[0] = $row['topic_last_poster_id'];
$poster[1] = $row['topic_last_poster_name'];
break;
case 1:
$poster[0] = $row['topic_poster'];
$poster[1] = $row['topic_first_poster_name'];
break;
}
$out_poster = '<br><font size=1 color="#FF9900" face="Tahoma">ostatnia przez: <a href="'. $adres_forum .'/memberlist.php?mode=viewprofile&u='. $poster[0] .'" target="'. $p .'">'. $poster[1] .'</a></font><br>';
}
if(strlen($row['topic_title']) > $w) { $row['topic_title'] = substr($row['topic_title'], 0, $w); }
$output .= $out_forum . $out_title . $out_answers . $out_poster .'<br/>';
}
echo $output;
mysql_close($db);
?>
Próbowałem z str_replace, strtr(), ale nie wiem czy do końca poprawnie

Z góry dziękuję za odpowiedzi i pozdrawiam, Piotr (ojs)