diff --git a/herbe.c b/herbe.c index 51d3990..4e8ad7f 100644 --- a/herbe.c +++ b/herbe.c @@ -56,6 +56,9 @@ int get_max_len(char *string, XftFont *font, int max_text_width) return ++i; } + while (eol && (string[eol] & 0xC0) == 0x80) + --eol; + if (info.width <= max_text_width) return eol; @@ -217,4 +220,4 @@ int main(int argc, char *argv[]) XCloseDisplay(display); return exit_code; -} \ No newline at end of file +}