From c84b0e8f3aaceb57182f40e0979e12b38c8fc046 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 18 Aug 2015 23:01:15 +0200 Subject: "Fix" UTF8 handling in split_words() --- src/shape.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shape.c b/src/shape.c index 74112b0..e5c568c 100644 --- a/src/shape.c +++ b/src/shape.c @@ -310,9 +310,10 @@ int split_words(struct wrap_line *boxes, PangoContext *pc, SCBlock *bl, /* Stuff up to (but not including) sc[i] forms a * wrap box */ len = offs - start; + /* FIXME: Ugh */ if ( log_attrs[i].is_mandatory_break ) { type = WRAP_SPACE_EOP; - if ( (i>0) && (text[i-1]=='\n') ) len--; + if ( (i>0) && (g_utf8_prev_char(ptr)[0]=='\n') ) len--; } else if ( (i>0) && log_attrs[i-1].is_expandable_space ) { type = WRAP_SPACE_INTERWORD; -- cgit v1.2.3