Forum

[SOLVED] $enforceUT...
 
Notifications
Retirer tout

[SOLVED] $enforceUTF8 always unset in Sql.php

3 Posts
2 Utilisateurs
0 Reactions
3,193 Vu
(@seb1981)
Posts: 16
Eminent Member
Début du sujet
 
[#2541]

Hi,

I have some problem with utf8 character on my mysql database. It is exactly the same issue explained here:

I have done everything from this post but i have always the problem.

So I modified Sql.php as follow:

//if (isset($enforceUTF8) and $enforceUTF8) {
    	  self::$connexion->query("SET NAMES utf8");
// }

After this, all is good. I check my parameter.php file and $enforceUTF8 = true is set.

Why $enforceUTF8 is not load as paramDbType from the GlobalParameter ?

because if I add this code before, everything ok

 
$enforceUTF8 = Parameter::getGlobalParameter('enforceUTF8'); // load enforceUTF8 parameter
// Could solve some erroneous default storing in non utf8 format  
if (isset($enforceUTF8) and $enforceUTF8) {
  self::$connexion->query("SET NAMES utf8");
}

Have a nice day

Environment

PROJEQTOR
==========
Version 5.0.5

MySQL
======
Serveur: Localhost via UNIX socket
Version du serveur: 5.5.40-0+wheezy1
Version du protocole: 10
Jeu de caractères pour MySQL: UTF-8 Unicode (utf8)

WEB SERVER
===========
Apache/2.2.22 (Debian)
Version du client MySQL: 5.5.40
Extension PHP: mysqli

PHP
===
PHP 5.4.36-0+deb7u1 (cli) (built: Dec 31 2014 07:31:33)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies


 
Posté : 21/08/2015 3:21 pm
(@babynus)
Posts: 14952
Membre Admin
 

You are right, there is an issue :
In Sql.php, line 246, add 1 line after getConnection definition :

  private static function getConnection() {
    global $enforceUTF8;

Why $enforceUTF8 is not load as paramDbType from the GlobalParameter ?

Because it is a DB paraemter, and all db parameters are stored in parameters.php file.


 
Posté : 21/08/2015 4:00 pm
(@seb1981)
Posts: 16
Eminent Member
Début du sujet
 

That works !

Thank you !


 
Posté : 21/08/2015 4:23 pm
Share:
Retour en haut