From 7b27328df6b6772cd70e1ed217f093a47f12c2a1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 21 Dec 2007 19:27:57 +0000 Subject: [PATCH] La gestion des bases en UTF8 sera au programme de la prochaine version --- htdocs/lib/databases/mysql.lib.php | 15 ++++++++------- htdocs/lib/databases/mysqli.lib.php | 13 +++++++------ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/htdocs/lib/databases/mysql.lib.php b/htdocs/lib/databases/mysql.lib.php index 5a3f73c649f..88b4400e573 100644 --- a/htdocs/lib/databases/mysql.lib.php +++ b/htdocs/lib/databases/mysql.lib.php @@ -158,13 +158,6 @@ class DoliDb $this->db = $this->connect($host, $user, $pass, $name, $newlink); if ($this->db) { - // Si client connecté avec charset different de celui de la base Dolibarr - // (La base Dolibarr a été forcée en this->forcecharset à l'install) - if (mysql_client_encoding ( $this->db ) != $this->forcecharset) - { - $this->query("SET NAMES '".$this->forcecharset."'", $this->db); - $this->query("SET CHARACTER SET ". $this->forcecharset); - } $this->connected = 1; $this->ok = 1; } @@ -185,6 +178,14 @@ class DoliDb $this->database_selected = 1; $this->database_name = $name; $this->ok = 1; + + // Si client connecté avec charset different de celui de la base Dolibarr + // (La base Dolibarr a été forcée en this->forcecharset à l'install) + /*if (mysql_client_encoding ( $this->db ) != $this->getDefaultCharacterSetDatabase()) + { + $this->query("SET NAMES '".$this->forcecharset."'", $this->db); + $this->query("SET CHARACTER SET ". $this->forcecharset); + }*/ } else { diff --git a/htdocs/lib/databases/mysqli.lib.php b/htdocs/lib/databases/mysqli.lib.php index e439aca7c5f..286627663fe 100644 --- a/htdocs/lib/databases/mysqli.lib.php +++ b/htdocs/lib/databases/mysqli.lib.php @@ -160,12 +160,6 @@ class DoliDb if ($this->db) { - // Si client connecté avec charset different de celui de Dolibarr - /*if (mysqli_client_encoding ( $this->db ) != $this->forcecharset) - { - $this->query("SET NAMES '".$this->forcecharset."'", $this->db); - $this->query("SET CHARACTER SET '".$this->forcecharset."'", $this->db); - }*/ $this->connected = 1; $this->ok = 1; } @@ -186,6 +180,13 @@ class DoliDb $this->database_selected = 1; $this->database_name = $name; $this->ok = 1; + + // Si client connecté avec charset different de celui de Dolibarr + /*if (mysqli_client_encoding ( $this->db ) != $this->getDefaultCharacterSetDatabase()) + { + $this->query("SET NAMES '".$this->forcecharset."'", $this->db); + $this->query("SET CHARACTER SET '".$this->forcecharset."'", $this->db); + }*/ } else {