all repos — st @ 11625c7166b7e4dad414606227acec2de1c36464

st (suckless terminal) config

Replace character with U+FFFD if wcwidth() is -1

Helpful when new Unicode codepoints are not recognized by libc.
czarkoff@gmail.com czarkoff@gmail.com
commit

11625c7166b7e4dad414606227acec2de1c36464

parent

008aae541b5cb1e67a025048adef9a06eaa11c2e

1 files changed, 4 insertions(+), 1 deletions(-)

jump to
M st.cst.c

@@ -2576,7 +2576,10 @@ width = 1;

unicodep = ascii = *c; } else { utf8decode(c, &unicodep, UTF_SIZ); - width = wcwidth(unicodep); + if ((width = wcwidth(unicodep)) == -1) { + c = "\357\277\275"; /* UTF_INVALID */ + width = 1; + } control = ISCONTROLC1(unicodep); ascii = unicodep; }