View ProjeQtOr On SourceForge.net
ProjeQtOr - Project Management Tool
Support us on Capterra
OIN - Open Invention Network
ProjeQtOr free project management software - UTF8 on display, wrong in database because twice converted (solved) - Page 4 - ProjeQtOr
 
 

UTF8 on display, wrong in database because twice converted (solved)

More
05 Aug 2014 19:00 #19 by Jean-Luc
Added in /files/config/parameters.php :
…
$logFile='../files/logs/projeqtor_${date}.log';
$logLevel='2';
$enforceUTF8=true;
//======= END
but don’t work, even with browser cache void. :(
Condition re-commented.
The topic has been locked.
More
05 Aug 2014 21:45 #20 by babynus
Hi,
It has nothing to do with browser cache as it is pure PHP concern.
Are you sure you are using ../files/config/parameters.php ?
You can check in /tool/parametersLocation.php the location of your parameters file.

It must work as it will do exactely the same than commenting condition as you first did.

Babynus
Administrator of ProjeQtOr web site
The topic has been locked.
More
06 Aug 2014 08:08 - 06 Aug 2014 08:09 #21 by Jean-Luc

babynus wrote: It has nothing to do with browser cache as it is pure PHP concern.

I know, but I have to test all possibilities.

babynus wrote: Are you sure you are using ../files/config/parameters.php ?

100% and more. What else ?

babynus wrote: You can check in /tool/parametersLocation.php the location of your parameters file.

There is only TWO "parameters.php" files in my projector directory :
../files/config/parameters.php <= referenced by parametersLocation.php, and from which I post a part above.
../tools/parameters.php

babynus wrote: It must work as it will do exactely the same than commenting condition as you first did.

Well, it doesn’t…
I checked all :
– parameters.php is loaded in tool/projeqtor.php (and if it was not, an error would occur on database access, isn’t it?)
– $enforceUTF8 is not used elsewhere than in ../model/persistence/Sql.php (except at installation in maintenance.php) and so can’t have been changed.
I’ill check in sql.php what’s the fuck for this variable…
Last edit: 06 Aug 2014 08:09 by Jean-Luc.
The topic has been locked.
More
27 Oct 2014 20:58 - 28 Oct 2014 04:50 #22 by 8omas

Jean-Luc wrote: Added in /files/config/parameters.php :

…
$logFile='../files/logs/projeqtor_${date}.log';
$logLevel='2';
$enforceUTF8=true;
//======= END
but don’t work, even with browser cache void. :(
Condition re-commented.


I use Greek and I have the same problem
The enforceUTF8 has effect only on new additions in the DB (and only if I do what I write in the end of this post).
After that, the already stored chars in DB, are shown strange
So I think that without this parameter, the characters sent to DB are not UTF8

When I set enforceUTF8 I had also to comment the if statement as in

Jean-Luc wrote: After migration to v4.4, flag 'enforceUTF8' is not set because existing, but need because UTF8 already enforced.
So I have commented the condition “if (isset($enforceUTF8) and $enforceUTF8)”.
But the proper method is to set the flag. Where to define it ?

in Sql.php and use
self::$connexion->query("SET NAMES utf8");
without the if statement (I made it mandatory)

After the above, I write in utf8 and the chars in DB are UTF8 (I can see them as Greek in phpmyAdmin and the projeqtor GUI)
Last edit: 28 Oct 2014 04:50 by 8omas.
The topic has been locked.
More
28 Oct 2014 13:26 #23 by babynus
the parameter "$enforceUTF8" is used to force the "self::$connexion->query("SET NAMES utf8");"
This will ensure that data is stored in UTF-8, even if your server is not fully configured in UTF-8.

But it is dedicated to new installs only.
If you have existing data, they will not be conveted automatically, because your MySql server in not completely configured in UTF8.
In your case, what you should do is :
- export your data
- convert exported file to UTF-8
- adapt my.ini to be full UTF-8 compliant
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8
- reload your data

All should be clean then.

Babynus
Administrator of ProjeQtOr web site
The topic has been locked.
More
28 Oct 2014 14:43 #24 by 8omas

babynus wrote: the parameter "$enforceUTF8" is used to force the "self::$connexion->query("SET NAMES utf8");"
This will ensure that data is stored in UTF-8, even if your server is not fully configured in UTF-8.

But it is dedicated to new installs only.
If you have existing data, they will not be conveted automatically, because your MySql server in not completely configured in UTF8.
In your case, what you should do is :
- export your data
- convert exported file to UTF-8
- adapt my.ini to be full UTF-8 compliant

[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8
- reload your data

All should be clean then.



I have the projeqtor in a fully UTF8 Linux server with other greek sites, and all behave as expected, without the proposed changes. If I make the changes you suggest, all other sites does not display correct UTF8 characters.

I think that the problem has to do with something like this:
mathiasbynens.be/notes/mysql-utf8mb4
The topic has been locked.
Moderators: babynusprotion
Time to create page: 0.033 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.