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 2 - ProjeQtOr
 
 

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

More
06 Jun 2014 17:47 #7 by babynus
Hi,

You may be right, as an encoding expert.

What is sure is that you retrieve correct formatting if :
- MySql server encoding parameter is correct ([mysqld] character-set-server = utf8)
- Databse is created with this correct parametering
I can also confirm that you'll retrieve the behaviour you describe if :
- You create database without correct parameters
- You modifiy server encoding parameter afterwards

Now, if you find in the code some unexpected encoding that could be fixed, I'll be glad to study the fix.
I'll spend no time to work on this as :
- application works fine whatever the server parameter
- behavior is correct if server parameter is correct (from the start)

Regards.

Babynus
Administrator of ProjeQtOr web site
The topic has been locked.
More
11 Jun 2014 17:19 - 11 Jun 2014 17:20 #8 by Jean-Luc

babynus wrote: What is sure is that you retrieve correct formatting if :
- MySql server encoding parameter is correct ([mysqld] character-set-server = utf8)

Yes

babynus wrote: - Databse is created with this correct parametering

Yes

babynus wrote: I can also confirm that you'll retrieve the behaviour you describe if :
- You create database without correct parameters

ALL parameters are OK

babynus wrote: - You modifiy server encoding parameter afterwards

I made a new installation besides, no changes after.

… But the problem still occurs !!!! One more time verified by internal dump view of the database file !

babynus wrote: Now, if you find in the code some unexpected encoding that could be fixed, I'll be glad to study the fix.
I'll spend no time to work on this as :
- application works fine whatever the server parameter

The problem is visible only with uses out of Projeqtor, e.g. PhpMyAdmin, access with external php programs, etc.
- behavior is correct if server parameter is correct (from the start)[/quote]

Notice: my database(s) are MySql, but with the InnoDb engine, not the MyIsam one, and Apache version is 2.4.9. What's the configuration on your server ?
Last edit: 11 Jun 2014 17:20 by Jean-Luc.
The topic has been locked.
More
11 Jun 2014 17:57 #9 by babynus
Hi,

Configuration is same as yours.

Did you try to store none ANSI characters on your Database (Cyrilics, chineese, Arabian).

I know it works fine with projector with correct database set.
Here are screenshots of examples from Demo :




Babynus
Administrator of ProjeQtOr web site
Attachments:
The topic has been locked.
More
11 Jun 2014 18:34 - 11 Jun 2014 18:38 #10 by Jean-Luc
As I said, within Projeqtor all displays OK, so you can show all screenshots you want, that don't probe anything.

But I try to use far UTF8 chars : the string ⁂€ – 0x2042 + 0x20AC, which should be stored as 6 bytes (hex: E2 81 82 E2 82 AC).

Therefore, the real stored string is not that one, and nor C3 A2 C2 81 C2 82 C3 A2 C2 82 C2 AC (UTF8 for 0xE2 0x81, etc.)

In fact, I found C3 A2 C2 81 E2 80 9A C3 A2 E2 80 9A C2 AC, 14 bytes !

It's the UTF8 conversion of the 6 bytes 0xE2… but with 0x82 replaced by 0x201A in the intermediate state !!!!!

0x201A being the Unicode low quotation mark replacing 0x82 as ANSI low quotation mark.

Is this the beginning of a track for you ?
Last edit: 11 Jun 2014 18:38 by Jean-Luc.
The topic has been locked.
More
12 Jun 2014 00:19 #11 by babynus

you can show all screenshots you want, that don't probe anything.

Second screenshot is from PhpMyAdmin, not from ProjeQtOr.

Is this the beginning of a track for you ?

Unfortunatly not.
I must admit I'm a bit lost with these explanations, and I don't know how you get these code to compare what is stored in my db.

Babynus
Administrator of ProjeQtOr web site
The topic has been locked.
More
12 Jun 2014 10:38 #12 by Jean-Luc
OK for the PhpMyAdmin screenshot, i didn’t pay attention enough…

After putting a trach in the Sql.php module, I notice that data seems to be send OK, so conversion is inner.

But this problem occurs ONLY with Projeqtor: all other installed or developped applications runs fine… included PhpMyAdmin.

So there is a major difference between, on the one hand, the non-object mysqli functions in my applications and the PMA object of PhpMyAdmin, and on the other hand, your sql object in Projeqtor.
What is your mysql library ?

For info, environment variables related to character set for the Projeqtor database are :
character_set_client = utf8
character_set_connection = utf8
character_set_database = utf8
character_set_filesystem = binary
character_set_results = utf8
character_set_server = utf8
character_set_system = utf8
character_sets_dir = /usr/share/mysql/charsets/
collation_connection = utf8_general_ci
collation_database = utf8_general_ci
collation_server = utf8_general_ci

According with all I found on the web, that's OK.

The only difference with all other databases is for these "collation database = utf8_unicode_ci", but this is also good and very, very edge effect possible. Actuel problem not concerned.

All services restarted, Projector reinstalled from zero… nothing has changed. All runs fine… except Projeqtor. :-(

Note: to see real storage, open database file with an hexadecimal editor or viewer. ;-)
(But I defined InnoDb to have separate tables, better for safety and easier to examinate)
The topic has been locked.
Moderators: babynusprotion
Time to create page: 0.058 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.