problem with utf8

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Hardkmel

    #1

    problem with utf8

    hi people,

    i have a script :
    <?
    $num=0;
    $backendURL = "http://rezo.net/backend/afp";

    $limit = 1; // nombre maxi de news à afficher.

    $file = fopen( $backendURL, "r");
    if( $file ) {
    $raw = fread( $file, 32000 );
    fclose( $file );
    if( eregi("<item>(. *)</item>", $raw, $rawitems ) ) {
    $items = explode("<item> ", $rawitems[0]);
    $nb = count($items );

    eregi("<title>( .*)</title>",$items[$num+1], $title);
    eregi("<link>(. *)</link>",$items[$num+1], $link);

    $tp2=$title[1];
    $tp3=$link[1];
    }
    } else {
    $tp2="Pas de news";
    }

    $tmp="info0_txt =".$tp2."&info0 _lien=".$tp3;
    $tmp=utf8_encod e($tmp);
    echo $tmp;

    ?>

    But the text isn't encoded by $tmp=utf8_encod e($tmp);
    IF I retrieve data from a base (mysql) that 's work !! WHY ?!
Working...