Prestashop: Add Emoji Support

Created on 19 Oct 2018  路  8Comments  路  Source: PrestaShop/PrestaShop

Actually with last version of PS1.7 it's still not possible to add emojis to products and categories, apart from the few supported by UTF-8 encoding.
I think in 2018 it's important having the possibility to add emoticon, in particular on meta descriptions and meta titles, because Google it's showing them also on SERP.

To do this it's needed to change utf8 encoding to utf8mb4:
https://mathiasbynens.be/notes/mysql-utf8mb4

CO Improvement

All 8 comments

HI @darfk3d3,

Thanks for your suggestion.
@eternoendless, @PrestaShop/prestashop-core-developers what do you think of his suggestion?
Thanks!

Hi @darfk3d3

We are aware of this issue. The problem is that utf8mb4 was added in MySql 5.5.3, while PrestaShop 1.7 must ensure compatibility with MySql 5.0 (see System requirements).

Unfortunately we cannot change this until the next major version of PrestaShop.

Hi @darfk3d3

We are aware of this issue. The problem is that utf8mb4 was added in MySql 5.5.3, while PrestaShop 1.7 must ensure compatibility with MySql 5.0 (see System requirements).

Unfortunately we cannot change this until the next major version of PrestaShop.

then instead of changing database, change connection parameter as optional parameter
https://dev.mysql.com/doc/refman/8.0/en/charset.html

and add this in BO -> Advanced -> DataBase (where already is an option to change character set and default is utf-8) as new option "Connection character set"

that will allow to use utf-8mb4 connection and users manually would be able to change character set in any table. Then with new possiblities to connect using diffrent character set, they will be able to use emoji.

what do you think?

I'm not sure it's a good idea to use a different character set in the connection and in the database, especially if you are thinking on using that to store characters not supported by the latter. This kinds of things can very easily escalate into codepage conversion hell if you're not very, very careful.

@darfk3d3 it's done now 馃槈 thanks to @PierreRambaud 's work

Great news.
To be able to use emoji we have to wait for PS1.7.7. to be released or there's a way to apply the modify also to previous PS versions?

Hi @darfk3d3,

Here are the exact files to add this new feature.
https://github.com/PrestaShop/PrestaShop/pull/14894/files

Thanks!

@khouloudbelguith Thank you!

Was this page helpful?
0 / 5 - 0 ratings