Forum

Welcome to ProjeQtOr new Forum. We migrated old forum to the new website.
You will find all your posts here, with your usual account.
Just one point : you’ll have to reinitialize your password. Use “Lost password” feature.

[SOLVED] $enforceUT...
 
Notifications
Clear all

[SOLVED] $enforceUTF8 always unset in Sql.php

3 Posts
2 Users
0 Reactions
3,233 Views
(@seb1981)
Posts: 16
Active Member
Topic starter
 
[#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


 
Posted : 21 Aug 2015 15H21
babynus
(@babynus)
Posts: 14966
Main Contributor 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.


 
Posted : 21 Aug 2015 16H00
(@seb1981)
Posts: 16
Active Member
Topic starter
 

That works !

Thank you !


 
Posted : 21 Aug 2015 16H23
Share:

Scroll to Top