comparison 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
comparison
equal deleted inserted replaced
1452:3f94a991d848 1453:328111d18d57
90 } else { 90 } else {
91 *len = 1 + (int)a_Utf8_end_of_char(s, 0); 91 *len = 1 + (int)a_Utf8_end_of_char(s, 0);
92 } 92 }
93 return ret; 93 return ret;
94 } 94 }
95
96 bool_t a_Utf8_combining_char(int unicode)
97 {
98 return ((unicode >= 0x0300 && unicode <= 0x036f) ||
99 (unicode >= 0x1dc0 && unicode <= 0x1dff) ||
100 (unicode >= 0x20d0 && unicode <= 0x20ff) ||
101 (unicode >= 0xfe20 && unicode <= 0xfe2f));
102 }