From ab87e5546ffb22d0bd812cb45558e656bfd1b36f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 19 Nov 2009 21:08:33 +0100 Subject: [PATCH] charset: added support for zero-width characters Consider zero-length characters in utf8_width(). --- NEWS | 1 + src/charset.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/NEWS b/NEWS index f5ff892..c79ec76 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,7 @@ ncmpc 0.16 - not yet released * screen_queue: move ranges with one single "move" command * status_bar: fix display_remaining_time while seeking * status_bar: display elapsed time event when total time is unknown +* charset: added support for zero-width characters ncmpc 0.15 - 2009-09-24 diff --git a/src/charset.c b/src/charset.c index 4400844..01d381b 100644 --- a/src/charset.c +++ b/src/charset.c @@ -39,6 +39,11 @@ charset_init(void) static inline unsigned unicode_char_width(gunichar ch) { +#if !GLIB_CHECK_VERSION(2,14,0) + if (g_unichar_iszerowidth(ch)) + return 0; +#endif + if (g_unichar_iswide(ch)) return 2; -- 2.30.2