In my hybrid Android/Cordova app I want to allow users to associate an Emoji with a descriptive "handle"/name. I have found that in Android 8+ the default HTML input box - rememember this a hybrid app so the UI is in fact a WebView derived directly from Chrome - it is possible to simply switch to the Emoji keyboard and choose an Emoji. My understanding is that these Emoji's are from Google's Noto font project. The format I want the user to be able to use for entering the emoji + handle is
🏁 handle
where the handle is required to be alphanummeric. Testing the alphanumeric part and the preceding space with a regex is not a problem. However I also want to institute a check that the first two bytes are an Emoji (not obligatory). Once again this can be done by getting the first two characters as userhandle.charCodeAt(0|1)
.
To check the validity of the numbers thus returned I need to know what constitutes a valid Noto font Emoji code. This article seems to suggest that all valid Emojis should have 0xF09fFor
0xE29C` as the value at Char 0 - I am going to ignore the three byte Emojis listed in that resource as being invalid for simplicity.
However, before I implement this I would like to know - is there an established way to validate Emoji unicode that I am unaware of here?
from Recognising Emojis in typed text
No comments:
Post a Comment