From fddcbe56c9c0f97ecea73ab9e39787f02ba72a68 Mon Sep 17 00:00:00 2001 From: ailin-nemui Date: Fri, 28 Jun 2019 11:29:19 +0200 Subject: [PATCH] Merge pull request #1057 from ailin-nemui/entry-8bit restore 8bit support in input entry (cherry picked from commit 8551dd99cc6ad29b1b356acc4f4c92209ed98eed) --- src/fe-text/gui-entry.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/fe-text/gui-entry.c b/src/fe-text/gui-entry.c index ee3de77d..eab3d4ca 100644 --- a/src/fe-text/gui-entry.c +++ b/src/fe-text/gui-entry.c @@ -379,11 +379,19 @@ static void gui_entry_draw_from(GUI_ENTRY_REC *entry, int pos) if (new_xpos > end_xpos) break; - if (entry->hidden) + if (entry->hidden) { g_string_append_c(str, ' '); - else if (unichar_isprint(c)) - g_string_append_unichar(str, c); - else { + } else if (unichar_isprint(c)) { + if (entry->utf8) { + g_string_append_unichar(str, c); + } else if (term_type == TERM_TYPE_BIG5) { + if(c > 0xff) + g_string_append_c(str, (c >> 8) & 0xff); + g_string_append_c(str, c & 0xff); + } else { + g_string_append_c(str, c); + } + } else { g_string_append_c(str, 4); g_string_append_c(str, FORMAT_STYLE_REVERSE); g_string_append_c(str, (c & 127)+'A'-1);