Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Messing up text that has emojis #156

Closed
Mj-binary opened this issue Jul 7, 2023 · 4 comments
Closed

Messing up text that has emojis #156

Mj-binary opened this issue Jul 7, 2023 · 4 comments
Labels

Comments

@Mj-binary
Copy link

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

  1. Copy and send the following text from Bob to Alice
    🔴Hello🔴
    🟠Hello🟠
    🟡Hello🟡
    🟢Hello🟢

  2. 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

@Mj-binary Mj-binary added the bug label Jul 7, 2023
@or-else
Copy link
Contributor

or-else commented Jul 7, 2023

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

@or-else
Copy link
Contributor

or-else commented Jul 13, 2023

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

@or-else
Copy link
Contributor

or-else commented Jul 13, 2023

Another option is regex \X: https://stackoverflow.com/a/74078861/6692196

@or-else
Copy link
Contributor

or-else commented May 22, 2024

Fixed in devel. '\X' does not work. The com.ibm.icu.text.BreakIterator works.

@or-else or-else closed this as completed May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants