Support for Emojis

Discuss requests for comments/changes posted in the Issue Tracker for the development of phpBB. Upcoming releases are 3.2/Rhea and 3.3.
User avatar
JoshyPHP
Registered User
Posts: 350
Joined: Fri Jul 08, 2011 9:43 pm

Re: Support for Emojis

Post by JoshyPHP » Wed Feb 17, 2016 2:46 am

Storage is fine but none of the librairies support skin tone variants for the emoji.

Hunchman801
Registered User
Posts: 12
Joined: Fri Sep 11, 2015 12:55 pm

Re: Support for Emojis

Post by Hunchman801 » Wed Feb 17, 2016 11:03 am

Yep:
👨🏻
👨🏼
👨🏽
👨🏾
👨🏿

What's the reason we're using libraries such as Twemoji here? All major OSs support emoji now and have their own set, meaning it would probably be easier to store the characters as such (using utf8mb4) and not worry about parsing them. That would not only allow compliance with the specifications but also mean that the emoji you type in the text field remains the same (for you) after submitting your post, instead of being replaced with some variant.

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1731
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: Support for Emojis

Post by DavidIQ » Wed Feb 17, 2016 1:49 pm

Hunchman801 wrote:
Wed Feb 17, 2016 11:03 am
What's the reason we're using libraries such as Twemoji here? All major OSs support emoji now and have their own set, meaning it would probably be easier to store the characters as such (using utf8mb4) and not worry about parsing them. That would not only allow compliance with the specifications but also mean that the emoji you type in the text field remains the same (for you) after submitting your post, instead of being replaced with some variant.
From the first post:
rfdy wrote:
Wed Apr 22, 2015 8:39 pm
  • Because emojis are not consistent across browsers and support for it is lacking in some browsers (ie. Emojis are all black/white in Mozilla Firefox), we use the Twitter Twemoji library (https://github.com/twitter/twemoji) to convert emoji characters to standardized images.
Image

Hunchman801
Registered User
Posts: 12
Joined: Fri Sep 11, 2015 12:55 pm

Re: Support for Emojis

Post by Hunchman801 » Wed Feb 17, 2016 2:04 pm

Just tried in Firefox 44.0.2 on OS X 10.11 and they show up fine. What versions/OSs are concerned?

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1731
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: Support for Emojis

Post by DavidIQ » Wed Feb 17, 2016 2:09 pm

The emoji set differs between pretty much all operating systems be it iOS, OSX, Android, Windows, and Unix distros. Even between different versions of each of those systems the emoji set can be different.
Image

Nicofuma
3.2 Release Manager
3.2 Release Manager
Posts: 297
Joined: Sun Apr 13, 2014 1:40 am
Location: Paris

Re: Support for Emojis

Post by Nicofuma » Wed Feb 17, 2016 2:35 pm

Just an example: for me (Ubuntu 14.04 + firefox or chrome) they are all black and white and only a small subset can be displayed.
Member of the phpBB Development-Team
No Support via PM

Hunchman801
Registered User
Posts: 12
Joined: Fri Sep 11, 2015 12:55 pm

Re: Support for Emojis

Post by Hunchman801 » Wed Feb 17, 2016 2:48 pm

DavidIQ wrote:
Wed Feb 17, 2016 2:09 pm
The emoji set differs between pretty much all operating systems be it iOS, OSX, Android, Windows, and Unix distros. Even between different versions of each of those systems the emoji set can be different.
Them being different is no issue, it's when they're not supported that it becomes a problem.
Nicofuma wrote:
Wed Feb 17, 2016 2:35 pm
Just an example: for me (Ubuntu 14.04 + firefox or chrome) they are all black and white and only a small subset can be displayed.
Thanks for your input, with this in mind it makes sense to use images.

In the future this might be supported everywhere though; how does TextFormatter store them? Did you guys switch to utf8mb4 or do you use XML entities?

User avatar
JoshyPHP
Registered User
Posts: 350
Joined: Fri Jul 08, 2011 9:43 pm

Re: Support for Emojis

Post by JoshyPHP » Wed Feb 17, 2016 4:21 pm

Stored as XML entities, displayed as UTF-8 characters.

Hunchman801
Registered User
Posts: 12
Joined: Fri Sep 11, 2015 12:55 pm

Re: Support for Emojis

Post by Hunchman801 » Wed Feb 17, 2016 5:12 pm

JoshyPHP wrote:
Wed Feb 17, 2016 4:21 pm
Stored as XML entities, displayed as UTF-8 characters.
Which are replaced with images when applicable, right?

Speaking of which, how easy is it to configure TextFormatter to use a set of images other than Twemoji (or EmojiOne for that matter)?

User avatar
JoshyPHP
Registered User
Posts: 350
Joined: Fri Jul 08, 2011 9:43 pm

Re: Support for Emojis

Post by JoshyPHP » Wed Feb 17, 2016 5:22 pm

Replaced where applicable, yes.

You can replace the default XSLT template using the configurator from the core.text_formatter_s9e_configure_after event. Something like that should work:

Code: Select all

$event['configurator']->tags['EMOJI']->template = '<img alt="{.}" class="emoji" draggable="false" width="16" height="16" src="//twemoji.maxcdn.com/16x16/{@seq}.png"/>';

Post Reply