From 7cb91c32139dc72aad02b9f11c1aad40ccb172a4 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Sun, 23 Jul 2006 13:04:39 +0200 Subject: [PATCH] Decode the second char from double glyph. When that char is splitted by convert_string and that char is the beginning of double glyph too we have a problem. This is a rare case. Must we care about it? --- src/document/html/renderer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/document/html/renderer.c b/src/document/html/renderer.c index 7d76d45ae..4f2a67a5a 100644 --- a/src/document/html/renderer.c +++ b/src/document/html/renderer.c @@ -454,7 +454,7 @@ set_hline(struct html_context *html_context, unsigned char *chars, int charslen, continue; } else { unsigned char i; - /* broken char */ +broken_char: /* broken char */ for (i = 0; chars < end;i++) { part->document->buf[i] = *chars++; } @@ -467,7 +467,9 @@ good_char: schar->data = (unicode_val_T)data; part->char_width[x] = 2; copy_screen_chars(&POS(x++, y), schar, 1); - schar->data = UCS_NO_CHAR; + data = utf_8_to_unicode(&chars, end); + if (data == UCS_NO_CHAR) goto broken_char; + schar->data = (unicode_val_T)data; part->spaces[x] = 0; part->char_width[x] = 0; } else {