Signal-android: Two question marks instead of emoji

Created on 24 May 2017  路  5Comments  路  Source: signalapp/Signal-Android

I have:


Bug description

If a space is inserted after an emoji at the end of a line,
sometimes two question marks are sent instead of the emoji.

Steps to reproduce

  • Create a new text message.
  • Enter about 15 emojis.
  • Move the cursor to the position after the 11th emoji (just before the end of the line) and insert a
    space. (The position may differ dependent on the screen resolution and/or the font size.)
  • Send the message.

Actual result: The 11th emoji is converted to two question marks.
Expected result: There should be the emoji.

Screenshots

screenshot_2017-05-24-10-22-20

Device info


Device: Wiko Pulp 4G
Android version: 5.1.1
Signal version: 4.6.0

emoji

Most helpful comment

I was able to reproduce this issue on Signal 4.6.1 on the Android Studio Emulator: Nexus_6_API_23.

After some investigation I think I understand what's happening, but I'm not sure how to fix it yet.

I inserted 13 emojis to fill up the first line, and the 14th would appear on the second line. When looking at the string representation it looked like there were two characters for every emoji character. So before I added a space after the 13th emoji character, the internal representation of the string was:

...\uD83D\uDE00\uD83D\uDE02

Where \uD83D\uDE00 was the 13th emoji at the end of the first line, and \uD83D\uDE02 was the 14th emoji at the beginning of the second line.

After inserting the space after the 13th emoji the internal string representation turned into this:

...\uD83D<SPACE_CHAR>\uDE00\uD83D\uDE02

So it looks like the space character gets inserted in between the two characters that represent the 13th emoji instead of in between the two emojis.

I also tested this with the same emojis and other single characters inserted at the end of the first line. I got similar broken results.

Would love to keep working on this. I'll keep investigating, but some suggestions would be appreciated.

All 5 comments

Reminds me a bit of this #5385

I don't have this issue on Signal 4.6.0 on Android 7.0.

I was able to reproduce this issue on Signal 4.6.1 on the Android Studio Emulator: Nexus_6_API_23.

After some investigation I think I understand what's happening, but I'm not sure how to fix it yet.

I inserted 13 emojis to fill up the first line, and the 14th would appear on the second line. When looking at the string representation it looked like there were two characters for every emoji character. So before I added a space after the 13th emoji character, the internal representation of the string was:

...\uD83D\uDE00\uD83D\uDE02

Where \uD83D\uDE00 was the 13th emoji at the end of the first line, and \uD83D\uDE02 was the 14th emoji at the beginning of the second line.

After inserting the space after the 13th emoji the internal string representation turned into this:

...\uD83D<SPACE_CHAR>\uDE00\uD83D\uDE02

So it looks like the space character gets inserted in between the two characters that represent the 13th emoji instead of in between the two emojis.

I also tested this with the same emojis and other single characters inserted at the end of the first line. I got similar broken results.

Would love to keep working on this. I'll keep investigating, but some suggestions would be appreciated.

This appears to be an Android framework bug on 6.x and below, as it is reproducible with a plain EditText in a new Android Studio project running on an API 23 emulator.

GitHub Issue Cleanup:
See #7598 for more information.

Was this page helpful?
0 / 5 - 0 ratings