From 1a10ec0c33c65877999b7e58cf682953b2016d37 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 24 Apr 2007 09:51:16 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20on=20force=20les=20enregistrement=20en?= =?UTF-8?q?=20latin1=20pour=20palier=20aux=20base=20de=20donn=E9es=20qui?= =?UTF-8?q?=20sont=20forc=E9e=20en=20utf8=20chez=20les=20h=E9bergeurs=20pa?= =?UTF-8?q?r=20exemple?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/lib/databases/mysql.lib.php | 3 +++ htdocs/lib/databases/mysqli.lib.php | 3 +++ 2 files changed, 6 insertions(+) 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; }