3 ms·
I’m biased towards websites, but truncating text server-side to provide an excerpt is something I need to do pretty often. Providing a count of remaining charac
by minitech 8y ago
I’m biased towards websites, but truncating text server-side to provide an excerpt is something I need to do pretty often. Providing a count of remaining characters is maybe less common, but Twitter, Mastodon, etc. need to do it, and people expect emoji (for example) to count as one.
Plus sometimes you’re the one building the text widget with the truncation option.
- moefh 8y agoTwitter's count of "characters" is code points after normalization[1]. I don't know who expects emoji to count as one character, but they'd be surprised by Twitter's behavior: something like [2] counts as 4 characters (woman, dark skin tone, zero width joiner, school). [1] https://developer.twitter.com/en/docs/basics/counting-characters.html https://developer.twitter.com/en/docs/basics/counting-charac... [2] https://emojipedia.org/female-teacher-type-6/ https://emojipedia.org/female-teacher-type-6/