zero-width-joiner handling for emojis

1 view
Skip to first unread message

Sertaç Ö. Yıldız

unread,
Sep 26, 2025, 6:16:17 AM (6 days ago) Sep 26
to news...@googlegroups.com
Hi,

The code for cleaning non-printable characters also replaces U+200D (ZERO WIDTH
JOINER) with U+FFFD (REPLACEMENT CHARACTER). This breaks displaying composite
emojis which are emoji ZWJ sequences.

I couldn’t compile and run the cpp tests, but the attached change fixes emoji
rendering for me. It may also fix
<https://github.com/newsboat/newsboat/issues/3159>.

While looking at the code, I noticed that `substr_with_width_stfl` function
iterates by characters instead of graphemes – which seemed wrong. Also,
`substr_with_width` function has an incorrect comment. I’m not sure about its
intended functionality, but the tests pass on the Rust side with the attached
changes.

--
~sertaç
/seɾtatʃ/
newsboat-zwj.diff
newsboat-substr-width.diff
signature.asc
Reply all
Reply to author
Forward
0 new messages