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

Prochaines Sessions

Les prochaines formations et démonstrations sont ouvertes, inscrivez-vous rapidement !

 

Démonstration de ProjeQtOr

(gratuit, sur inscription)
 

13 mai 2025 (10h30-12h)

5 juin 2025 (16h-17h30)

 
 

Planifiez avec ProjeQtOr

14 et 15 mai 2025 (9h-12h30)

18 et 19 juin 2025 (9h-12h30)

 
 

Administrez avec ProjeQtOr

20 et 21 mai (9h-12h30)

25 et 26 juin (9h-12h30)

 

 

 

[SOLVED] $enforceUTF8 always unset in Sql.php

More
21 Aoû 2015 13:21 - 21 Aoû 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 Aoû 2015 13:29 by seb1981. Reason: Adding environment specification

Please Connexion or Create an account to join the conversation.

More
21 Aoû 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 Connexion or Create an account to join the conversation.

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

Thank you !

Please Connexion or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.037 seconds

Paramétrages de cookies

×

Cookies fonctionnels

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

Veuillez vous connecter pour voir vos activités!

Autres cookies

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