function getProperUTF8Decode($texto) { return codificacao($texto) == 'UTF-8' ? utf8_decode($texto) : $texto; }
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); } } }