e107inc / e107

e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107
https://e107.org
GNU General Public License v3.0
321 stars 213 forks source link

problem with database charset with national characters #2503

Closed Jimmi08 closed 6 years ago

Jimmi08 commented 7 years ago

I didn't notice this before because e107 frontend somehow managed this. But I use the same database with other CMS and I noticed this:

If I use national characters in e107 admin (German, Slovak) they are saved in database this way: image

I checked: image image image image

If I insert data right in database,
image e107 is not able to manage it. image

Thanks

Jimmi08 commented 7 years ago

Can't be this reason?

image

Jimmi08 commented 7 years ago

Ok, I has used MariaDB 10. After export and import to MariaDB 5, it looks to work as should it be.

Server version: 5.5.53-MariaDB-1ubuntu0.14.04.1 - (Ubuntu)

Server version: 10.1.21-MariaDB-1~trusty - mariadb.org binary distribution

tgtje commented 7 years ago

After reading into these things, and combining and extraction of answers i would assume, it could be that while utf8mb4....is used for connection ...overall it seems that the collation for database and server ALSO (at least proposed) have these set as utf8mb4 (maybe charset too).. As mentioned it is a extraction of answers..if it realy is that way...(no testground).. also a (maybe pointer, but interesting : http://mysql.rjweb.org/doc.php/charcoll

Jimmi08 commented 7 years ago

Confirmed with XAMPP for 7.0.15 / PHP 7.0.15. It uses Server version: 10.1.21-MariaDB - mariadb.org binary distribution Server charset: UTF-8 Unicode (utf8) Server connection collation: image Database:

image

Table: image

Data in phpmyadmin:

image

Data in e107: image

CaMer0n commented 7 years ago

@Jimmi08 I haven't performed a fresh install yet, but I did take an existing install and run it on MariaDB10 and then post comments in the chatbox. See below:

screenshot-localhost-2017-04-19-08-13-32

screenshot-localhost-2017-04-19-08-12-45

screenshot-localhost-2017-04-19-08-33-53

I suspect your problem may be due to the charset(s) you are exporting/importing with.

CaMer0n commented 7 years ago

Fresh install of e107 on MariaDB10 - still no problem found. Posted Japanese via the admin > News area.

screenshot-localhost-2017-04-19-08-46-37

Jimmi08 commented 7 years ago

Check please your database. Or try insert them in via phpmyadmin. If they are correct in db,they are wrong in e107. If you use only e107 edit, they are saved wrong in database, but frontend is correct. I used data from db version 5 and it was displayed wrong.

CaMer0n commented 7 years ago

Still no issue, if I paste Japanese directly into PHPMyadmin it displays correctly. If I post via e107's admin or chatbox it is stored correctly.

Jimmi08 commented 6 years ago

Closing. I will open new issue this if this happens again.

rica-carv commented 6 years ago

I'm still havig this issue in parts of my theme, strangelly.... Haven't figured out how and why they happen only in that parts... I got all files saved on UTF-8 charset, and it still happens...