diff --git a/htdocs/lib/databases/mysql.lib.php b/htdocs/lib/databases/mysql.lib.php index 965becb713f..6eb32b6b420 100644 --- a/htdocs/lib/databases/mysql.lib.php +++ b/htdocs/lib/databases/mysql.lib.php @@ -3,6 +3,7 @@ * Copyright (C) 2002-2007 Rodolphe Quiedeville * Copyright (C) 2004-2006 Laurent Destailleur * Copyright (C) 2006 Andre Cianfarani + * Copyright (C) 2005-2007 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -206,6 +207,8 @@ class DoliDb { dolibarr_syslog("DoliDB::connect host=$host, login=$login, passwd=--hidden--, name=$name"); $this->db = @mysql_connect($host, $login, $passwd); + //force les enregistrement en latin1 si la base est en utf8 par défaut + $x=$this->query('SET NAMES latin1'); return $this->db; } diff --git a/htdocs/lib/databases/mysqli.lib.php b/htdocs/lib/databases/mysqli.lib.php index ba03950cf6c..e0ccdfc5656 100644 --- a/htdocs/lib/databases/mysqli.lib.php +++ b/htdocs/lib/databases/mysqli.lib.php @@ -3,6 +3,7 @@ * Copyright (C) 2002-2005 Rodolphe Quiedeville * Copyright (C) 2004-2006 Laurent Destailleur * Copyright (C) 2006 Andre Cianfarani + * Copyright (C) 2005-2007 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -197,6 +198,8 @@ class DoliDb { dolibarr_syslog("DoliDB::connect host=$host, login=$login, passwd=--hidden--, name=$name"); $this->db = @mysqli_connect($host, $login, $passwd); + //force les enregistrement en latin1 si la base est en utf8 par défaut + $x=$this->query('SET NAMES latin1'); //print "Resultat fonction connect: ".$this->db; return $this->db; }