phpmysqlfacebookutf-8iso-8859-2

Convert utf-8 to iso-8859-2 (polish)


I have some problems downloading data event from facebook. I have a site ,add.php, - this site is UTF-8, next I'm sending a data to mysql (utf-8) and then I'm displaying information on website (iso-8859-2). Problem is when I'm displaying this data there are no polish signs.

How can I convert this data to iso-8859-2 like on original event facebook page?

I was trying iconv but it doesn't work:

function utf2iso( $tekst ) {
  iconv( "UTF-8", "ISO-8859-2", $tekst );
  return $tekst;
  };

Iconv doesn't works, please help - give me some advice!

PS. Sorry for my english :-)


Solution

  • iconv() returns converted text or false, but doesn't modify reference

    function utf2iso( $tekst ) {
        return iconv( "UTF-8", "ISO-8859-2", $tekst );
    };