diff src/utf8.cc @ 1453:328111d18d57

respect UTF-8 when splitting long lines in plain.cc (noticed by corvid) When splitting long lines in plain text to avoid X11 coordinate overflows we need to make sure that multibyte UTF-8 chars are not split. Additionally combining chars like accents should stay together with their base char.
author Johannes Hofmann <Johannes.Hofmann@gmx.de>
date Sun, 29 Nov 2009 21:40:02 +0100
parents 5d6869b28e4d
children 719f4bae567c
line wrap: on
line diff
--- a/src/utf8.cc	Fri Nov 27 20:05:36 2009 +0100
+++ b/src/utf8.cc	Sun Nov 29 21:40:02 2009 +0100
@@ -92,3 +92,11 @@
    }
    return ret;
 }
+
+bool_t a_Utf8_combining_char(int unicode)
+{
+   return ((unicode >= 0x0300 && unicode <= 0x036f) ||
+           (unicode >= 0x1dc0 && unicode <= 0x1dff) ||
+           (unicode >= 0x20d0 && unicode <= 0x20ff) ||
+           (unicode >= 0xfe20 && unicode <= 0xfe2f));
+}