Messing up text that has emojis
If you paste the text that has emojis from somewhere else into the program, when you send the message, the message will be messed up in the Tindroid. (Everything is fine in the Webapp)
To Reproduce
-
Copy and send the following text from Bob to Alice 🔴Hello🔴 🟠Hello🟠 🟡Hello🟡 🟢Hello🟢
-
After sending the text, both Alice and Bob will see the following text 🔴Hello � 🟠Hel o🟠 🟡H llo🟡 🟢Hello🟢
Expected behavior The text is sent and displayed correctly
Tindroid Version 0.22.8 (1665) Device Xiaomi 11t Android 13
Server sandbox.tinode.co
The problem here is the length of compound emojis. It's not an easy fix. This is the same reason why this test fails: https://github.com/tinode/tindroid/blob/master/tinodesdk/src/test/java/co/tinode/tinodesdk/model/DraftyTest.java#L83
The right approach to this problem would be to use https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/text/BreakIterator.html
Another option is regex \X: https://stackoverflow.com/a/74078861/6692196
Fixed in devel. '\X' does not work. The com.ibm.icu.text.BreakIterator works.