From 3db0d50df44d91a110f9320cb4fd327c97b96df2 Mon Sep 17 00:00:00 2001 From: nicm Date: Sat, 14 Nov 2015 12:03:23 +0000 Subject: [PATCH 1/2] The private use area at U+E000 to U+F8FF is not very useful if it is width 0, make it width 1 instead. --- utf8.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utf8.c b/utf8.c index 1bfea079..b391c5ec 100644 --- a/utf8.c +++ b/utf8.c @@ -264,7 +264,7 @@ static struct utf8_width_entry utf8_width_table[] = { { 0x0abe5, 0x0abe5, 0, NULL, NULL }, { 0x0abed, 0x0abed, 0, NULL, NULL }, { 0x0f900, 0x0fa6d, 2, NULL, NULL }, - { 0x0d800, 0x0f8ff, 0, NULL, NULL }, + { 0x0d800, 0x0dfff, 0, NULL, NULL }, { 0x0fa70, 0x0fad9, 2, NULL, NULL }, { 0x0fff9, 0x0fffb, 0, NULL, NULL }, { 0x0fe30, 0x0fe52, 2, NULL, NULL }, From 14d90e4901ef943e57e5dada7a0f53b2dc208571 Mon Sep 17 00:00:00 2001 From: nicm Date: Sat, 14 Nov 2015 12:20:19 +0000 Subject: [PATCH 2/2] The character is an int so use %x not %hhx. --- input.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/input.c b/input.c index f7b4e460..6e1fec90 100644 --- a/input.c +++ b/input.c @@ -1924,7 +1924,7 @@ input_utf8_open(struct input_ctx *ictx) struct utf8_data *ud = &ictx->utf8data; if (utf8_open(ud, ictx->ch) != UTF8_MORE) - log_fatalx("UTF-8 open invalid %#hhx", ictx->ch); + log_fatalx("UTF-8 open invalid %#x", ictx->ch); log_debug("%s %hhu", __func__, ud->size); @@ -1938,7 +1938,7 @@ input_utf8_add(struct input_ctx *ictx) struct utf8_data *ud = &ictx->utf8data; if (utf8_append(ud, ictx->ch) != UTF8_MORE) - log_fatalx("UTF-8 add invalid %#hhx", ictx->ch); + log_fatalx("UTF-8 add invalid %#x", ictx->ch); log_debug("%s", __func__); @@ -1952,7 +1952,7 @@ input_utf8_close(struct input_ctx *ictx) struct utf8_data *ud = &ictx->utf8data; if (utf8_append(ud, ictx->ch) != UTF8_DONE) - log_fatalx("UTF-8 close invalid %#hhx", ictx->ch); + log_fatalx("UTF-8 close invalid %#x", ictx->ch); log_debug("%s %hhu '%*s' (width %hhu)", __func__, ud->size, (int)ud->size, ud->data, ud->width);