From 06546fe50ce8a03df5fe73027873467aa21e6244 Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Mon, 7 Sep 2009 16:06:40 +0200 Subject: [PATCH] Take into account unichar space on converting to plain text quoted text (fixes NB#134827). --- src/modest-text-utils.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/modest-text-utils.c b/src/modest-text-utils.c index 020b160..99cb710 100644 --- a/src/modest-text-utils.c +++ b/src/modest-text-utils.c @@ -973,6 +973,7 @@ modest_text_utils_quote_body (GString *output, const gchar *text, g_string_prepend (l, remaining->str); } else { do { + gunichar remaining_first; breakpoint = get_breakpoint (remaining->str, rem_indent, @@ -981,9 +982,11 @@ modest_text_utils_quote_body (GString *output, const gchar *text, remaining, breakpoint); g_string_erase (remaining, 0, breakpoint); - if (remaining->str[0] == ' ') { - g_string_erase (remaining, 0, - 1); + remaining_first = g_utf8_get_char_validated (remaining->str, remaining->len); + if (remaining_first != ((gunichar) -1)) { + if (g_unichar_isspace (remaining_first)) { + g_string_erase (remaining, 0, g_utf8_next_char (remaining->str) - remaining->str); + } } } while (remaining->len); } -- 1.7.9.5