Hello!
I would like to prevent users from using emojis in comments, however I have absolutely no idea how to accomplish that. Have you got any advice, folks?
Discussion posts and replies are publicly visible
Why do you want to ban them? Because of database issues?
It has been requested, I am not sure why, but I doubt there were any database considerations behind this request.
I'd suspect simply passing hand-entered text through clean() would filter out most or all such things. And if not, you could always go brute-force and use cleanWith() to enforce a strict whitelist of allowed characters (though you'd have to be fairly careful to be inclusive enough of unusual-but-allowable special characters).
Blocking a set of specific characters is not simple. To specifically block emojis, you would have to exclude multiple ranges of unicode characters.
Something like this: https://gist.github.com/aabed/63c4bfde6a510395657a2ee3383716dd
Thank you. That would probably the best way.