diff -urN xchat-gnome-0.24.0/src/fe-gnome/xtext.c xchat-gnome-0.24.0.new/src/fe-gnome/xtext.c --- xchat-gnome-0.24.0/src/fe-gnome/xtext.c 2008-09-07 16:18:10.000000000 +0200 +++ xchat-gnome-0.24.0.new/src/fe-gnome/xtext.c 2008-10-12 00:28:44.000000000 +0200 @@ -77,9 +77,16 @@ #endif /* is delimiter */ -#define is_del(c) \ - (c == ' ' || c == '\n' || c == ')' || c == '(' || \ - c == '>' || c == '<' || c == ATTR_RESET || c == ATTR_BOLD || c == 0) +static int is_del(const char *c) { + int ret; + ret = 0; + ret = (c[0] == ' ' || c[0] == '\n' || c[0] == ')' || c[0] == '(' || + c[0] == '>' || c[0] == '<' || c[0] == ATTR_RESET || c[0] == ATTR_BOLD || c == 0); + if(!ret) { + ret = strncmp(c, "“", 3) == 0 || strncmp(c, "”", 3) == 0; + } + return ret; +} #ifdef SCROLL_HACK /* force scrolling off */ @@ -1813,6 +1820,7 @@ int offset; unsigned char *str; unsigned char *word; + unsigned char *nstr; int len; int out_of_bounds = 0; @@ -1833,16 +1841,16 @@ str = ent->str + offset; - while (!is_del (*str) && str != ent->str) - str--; - word = str + 1; + while (!is_del(str)) + str = g_utf8_prev_char(str); + word = g_utf8_next_char(str); len = 0; str = word; - while (!is_del (*str) && len != ent->str_len) - { - str++; - len++; + while (!is_del(str) && len != ent->str_len) { + nstr = g_utf8_next_char(str); + len += nstr - str; + str = nstr; } if (len > 0 && word[len-1]=='.') @@ -3882,7 +3890,7 @@ } /* keep a record of the last space, for wordwrapping */ - if (is_del (*str)) + if (g_unichar_isspace(g_utf8_get_char(str))) { last_space = str; limit_offset = 0;