From: Max Kellermann Date: Thu, 19 Nov 2009 20:08:33 +0000 (+0100) Subject: charset: added support for zero-width characters X-Git-Tag: release-0.16~21 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ab87e5546ffb22d0bd812cb45558e656bfd1b36f;p=ncmpc.git charset: added support for zero-width characters Consider zero-length characters in utf8_width(). --- 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;