Handle wcwidth() and mbtowc() failures in better style and drop

characters where we can't find the width (wcwidth() fails) on input, the
same as we drop invalid UTF-8. Suggested by schwarze@.
This commit is contained in:
nicm
2016-03-02 15:36:02 +00:00
parent d980d965dd
commit b8a102d26f
5 changed files with 48 additions and 21 deletions

3
tmux.h
View File

@ -2316,8 +2316,7 @@ void utf8_set(struct utf8_data *, u_char);
void utf8_copy(struct utf8_data *, const struct utf8_data *);
enum utf8_state utf8_open(struct utf8_data *, u_char);
enum utf8_state utf8_append(struct utf8_data *, u_char);
u_int utf8_width(wchar_t);
wchar_t utf8_combine(const struct utf8_data *);
enum utf8_state utf8_combine(const struct utf8_data *, wchar_t *);
enum utf8_state utf8_split(wchar_t, struct utf8_data *);
int utf8_strvis(char *, const char *, size_t, int);
char *utf8_sanitize(const char *);