vapor / fluent-mysql-driver

🖋🐬 Swift ORM (queries, models, relations, etc) built on MySQL.
MIT License
77 stars 52 forks source link

Not able to store special characters and emojis properly #184

Closed diegotl closed 4 years ago

diegotl commented 4 years ago

I'm rewriting an old API build with Vapor 2 to Vapor 4. But this time I can't seem to store accents, special characters and emojis properly. I have the table encoding and collation set to utf8mb4 but still, when seeing from Sequel, I see them like "Chapéu 🎓".

Is there a way to fix it currently? Thanks

tanner0101 commented 4 years ago

As far as I know, this is determined by the MySQL server. MySQLNIO is already specifying utf8mb4 as the desired character set: https://github.com/vapor/mysql-nio/blob/master/Sources/MySQLNIO/MySQLConnectionHandler.swift#L160

Double check your database is using utf8mb4 and utf8mb4_unicode_ci and that everything was converted correctly.