]> Skullheadx's Git Forge - dmenu.git/commit
render invalid utf8 sequences as U+FFFD
authorNRK <nrk@disroot.org>
Thu, 4 Jul 2024 21:27:47 +0000 (21:27 +0000)
committerHiltjo Posthuma <hiltjo@codemadness.org>
Sun, 14 Jul 2024 09:42:58 +0000 (11:42 +0200)
commit59936c7d972587a47d61161279bb8e8abc0b02f3
tree52cac2b80581df58cd6ba7fddaa2eafc2fb5e9dc
parent51e32d49b56c86cd288c64fccf6cd765547781b9
render invalid utf8 sequences as U+FFFD

previously drw_text would do the width calculations as if
invalid utf8 sequences were replaced with U+FFFD but would pass
the invalid utf8 sequence to xft to render where xft would just
cut it off at the first invalid byte.

this change makes invalid utf8 render as U+FFFD and avoids
sending invalid sequences to xft. the following can be used to
check the behavior before and after the patch:

$ printf "0\xef1234567\ntest" | dmenu

Ref: https://lists.suckless.org/dev/2407/35646.html
drw.c