Code

charset: added support for zero-width characters
authorMax Kellermann <max@duempel.org>
Thu, 19 Nov 2009 20:08:33 +0000 (21:08 +0100)
committerMax Kellermann <max@duempel.org>
Thu, 19 Nov 2009 20:08:33 +0000 (21:08 +0100)
Consider zero-length characters in utf8_width().

NEWS
src/charset.c

diff --git a/NEWS b/NEWS
index f5ff89273899f03de142d8db311525793e83ba66..c79ec7656b56e91aacd002fb73f479e0665c336a 100644 (file)
--- 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
index 440084406d2f5837d239a356da48b5f068294a9f..01d381b5d1303d0301360a7fafc919ac1dc701db 100644 (file)
@@ -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;