diff --git a/ecrire/inc_charsets.php3 b/ecrire/inc_charsets.php3 index bf8525f100784e9310a795e01654b884caf3143c..febf082a1477416277717b78b49ade4c7fed3482 100644 --- a/ecrire/inc_charsets.php3 +++ b/ecrire/inc_charsets.php3 @@ -291,12 +291,14 @@ function charset2unicode($texte, $charset='AUTO', $forcer = false) { $trans[$charset][chr($key)] = '&#'.$val.';'; } } - if ($GLOBALS['flag_strtr2']) - $texte = strtr($texte, $trans[$charset]); - else { - reset($trans[$charset]); - while (list($from, $to) = each($trans[$charset])) { - $texte = str_replace($from, $to, $texte); + if ($trans[$charset]) { + if ($GLOBALS['flag_strtr2']) + $texte = strtr($texte, $trans[$charset]); + else { + reset($trans[$charset]); + while (list($from, $to) = each($trans[$charset])) { + $texte = str_replace($from, $to, $texte); + } } } return $texte;