diff --git a/include/class/acc_bilan.class.php b/include/class/acc_bilan.class.php index 9b30ed5e1..3f398e09c 100644 --- a/include/class/acc_bilan.class.php +++ b/include/class/acc_bilan.class.php @@ -398,7 +398,10 @@ class Acc_Bilan $regex="/<<\\$[A-Z]*[0-9]*>>/"; $lt="<"; $gt=">"; - $header_txt=utf8_encode(header_txt($this->db)); + // convert to UTF8 + $header_txt=iconv('ISO-8859-1','UTF-8//IGNORE',header_txt($this->db)); + + while ( !feof($p_file) ) { diff --git a/include/class/dossier.class.php b/include/class/dossier.class.php index e4aafdcf1..46c53e615 100644 --- a/include/class/dossier.class.php +++ b/include/class/dossier.class.php @@ -171,7 +171,7 @@ class Dossier try { $http=new HttpInput(); $id=$http->request("gDossier","number"); - if ($id > 999999 || $id < 0) throw new \Exception(_("Dossier max dépassé")); + if ($id > 999999 || $id < 0) throw new \Exception(_("Dossier max dépassé ")); } catch (\Exception $e) { die('Dossier invalide '); diff --git a/include/header_print.php b/include/header_print.php index 7a510a068..8f4aaacf5 100644 --- a/include/header_print.php +++ b/include/header_print.php @@ -34,7 +34,10 @@ function header_txt($p_cn) $soc=$own->MY_NAME; $date=date('d / m / Y H:i '); - $dossier=utf8_decode(" Dossier : ".dossier::name()); + $str=sprintf(" Dossier : %s",dossier::name()); + // convert to latin1 + $dossier=iconv('UTF-8','ISO-8859-1//IGNORE',$str); + return $dossier." ".$soc." ".$date; } diff --git a/include/lib/ac_common.php b/include/lib/ac_common.php index cf3d0300e..dcab67a9f 100644 --- a/include/lib/ac_common.php +++ b/include/lib/ac_common.php @@ -1374,14 +1374,17 @@ if(!function_exists('tracedebug')) { } } /** - * @brief encode the string for RTF, return a stringu + * @brief encode the string for RTF, return a string * @param $p_string string to convert * @return string */ function convert_to_rtf($p_string) { $result=""; - $p_string2=utf8_decode($p_string); + // convert to latin + $p_string2=iconv('UTF-8','ISO-8859-1//IGNORE',$p_string); + + $nb_result=strlen($p_string2); for ($i = 0 ; $i < $nb_result ; $i++ ){ if (ord($p_string[$i]) < 127 ) { diff --git a/include/lib/noalyss_csv.class.php b/include/lib/noalyss_csv.class.php index 47a2acdb8..dbd389afd 100644 --- a/include/lib/noalyss_csv.class.php +++ b/include/lib/noalyss_csv.class.php @@ -181,7 +181,7 @@ class Noalyss_Csv protected function encode($str) { if ($this->encoding=="utf8") return $str; - if ($this->encoding=="latin1") return utf8_decode ($str); + if ($this->encoding=="latin1") return iconv('UTF-8','ISO-8859-1//IGNORE',$str); throw new Exception(_("Encodage invalide")); } /**