ProcessWire icon indicating copy to clipboard operation
ProcessWire copied to clipboard

Comments field & Emojis

Open Notanotherdotcom opened this issue 9 years ago • 2 comments

When using InnoDB and utf8mb4 in my database so that I can let users post emoji characters into comments, I'm running into a very similar issue described here: https://github.com/ryancramerdesign/ProcessWire/issues/2020

I think it's reasonable to allow folks to use emoji if they're commenting from a phone for example.

Notanotherdotcom avatar Nov 18 '16 21:11 Notanotherdotcom

Hmm... perhaps a better solution would be to parse them and store them in the database with shorttags, something like is suggested here: https://github.com/Ranks/emojione with the relevant function here: http://git.emojione.com/demos/latest/phptoshort.php

So the smiley emoji gets translated to :smile: before being stored in the DB, then go back the other way when rendering: http://git.emojione.com/demos/latest/phpshortnametoimage.php#output

Notanotherdotcom avatar Nov 18 '16 22:11 Notanotherdotcom

I successfully used InnoDB and utf8mb4 for saving emojis.

Check this project https://github.com/NinjasCL/voxgram

Also keep in mind that emojis needs mb_ functions in php for string manipulation. https://github.com/NinjasCL/voxgram/blob/master/templates/helpers/utf8.php

clsource avatar Oct 15 '17 15:10 clsource