This is a follow up to a discussion from the dev list:
https://lists.suckless.org/dev/2407/35646.html
I've separated the patch into two halves.
1. Replaces the current utf8decoder with a shorter and more direct one.
It reports back errors and how much to advance on error (needed for the
next patch)
2. Detects invalid utf8 bytes and renders them as U+FFFD instead of
passing invalid bytes to xft which cuts it off.
If keeping the current utf8 decoder is important, I can look into how to
change it so that it can return error information back to the caller.
But IMHO the current decoder is unnecessarily overcomplicated for
libsl's need.
The interaction between invalid utf8 sequence and ellipsis is a bit
finicky and could use some extra eyes. But so far it has worked well in
my testing.
- NRK
Received on Fri Jul 05 2024 - 04:40:45 CEST