mirror of
https://github.com/pachli/pachli-android.git
synced 2025-01-24 06:04:07 +01:00
098983f401
Mastodon counts post lengths by considering emojis to be single characters, no matter how many unicode code points they are composed of. So "😜" has length 1. Pachli was using `String.length`, which considers "😜" as length 2. Correct the calculation by using a BreakIterator to count the characters in the string, which treats multi-character emojis as a length 1. Poll options had a similar problem, exacerbated by the Mastodon web UI also having the same problem, see https://github.com/mastodon/mastodon/issues/28336. Fix that by creating `MastodonLengthFilter`, an `InputFilter` that does the right thing for regular text that may contain emojis. See also https://github.com/tuskyapp/Tusky/pull/4152, which has the fix for status length but not polls. --------- Co-authored-by: Konrad Pozniak <opensource@connyduck.at> |
||
---|---|---|
.. | ||
src | ||
build.gradle.kts | ||
lint-baseline.xml |