View ProjeQtOr On SourceForge.net
ProjeQtOr - Project Management Tool
Support us on Capterra
OIN - Open Invention Network
ProjeQtOr free project management software - [SOLVED] $enforceUTF8 always unset in Sql.php - ProjeQtOr
 

[SOLVED] $enforceUTF8 always unset in Sql.php

More
21 Aug 2015 13:21 - 21 Aug 2015 13:29 #1 by seb1981
Hi,

I have some problem with utf8 character on my mysql database. It is exactly the same issue explained here: http://www.projeqtor.org/fr/forum-fr/2-submit-issues/5799-utf8-on-display,-wrong-in-database-because-twice-converted-solved?start=18#8625

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

Last edit: 21 Aug 2015 13:29 by seb1981. Reason: Adding environment specification

Please Log in or Create an account to join the conversation.

More
21 Aug 2015 14:00 #2 by babynus
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.

Babynus
Administrator of ProjeQtOr web site
The following user(s) said Thank You: seb1981

Please Log in or Create an account to join the conversation.

More
21 Aug 2015 14:23 #3 by seb1981
That works !

Thank you !

Please Log in or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.041 seconds

Cookies settings

×

Functional Cookies

Ce site utilise des cookies pour assurer son bon fonctionnement et ne peuvent pas être désactivés de nos systèmes. Nous ne les utilisons pas à des fins publicitaires. Si ces cookies sont bloqués, certaines parties du site ne pourront pas fonctionner.

Session

Please login to see yours activities!

Other cookies

Ce site web utilise un certain nombre de cookies pour gérer, par exemple, les sessions utilisateurs.