예제 #1
0
파일: utils.php 프로젝트: alejesus/fato
function getProperUTF8Decode($texto)
{
    return codificacao($texto) == 'UTF-8' ? utf8_decode($texto) : $texto;
}
예제 #2
0
 function convert_to_utf8()
 {
     $sql = "select * from " . $this->tabela;
     $rlt = db_query($sql);
     while ($line = db_read($rlt)) {
         $tx = trim($line['msg_content']);
         $tx2 = $tx;
         $tchar = codificacao($tx);
         if ($tchar == 'ISO-8859-1') {
             $tx2 = utf8_encode($tx);
             $sql = "update " . $this->tabela . " \n\t\t\t\t\t\t\t\t\tset msg_content = '" . $tx2 . "'\n\t\t\t\t\t\t\t\t\twhere id_msg = " . $line['id_msg'];
             $rrr = db_query($sql);
             echo '<BR>' . $tx . '-' . $tx2;
             echo '==' . codificacao($tx);
         }
     }
 }