diff --git a/edit/editdraw.c b/edit/editdraw.c index 20e5056cb..2e0ccff2b 100644 --- a/edit/editdraw.c +++ b/edit/editdraw.c @@ -485,14 +485,15 @@ edit_draw_this_line (WEdit *edit, long b, long row, long start_col, break; } if (!edit->utf8) { - if (is_printable (c)) { - p->ch = c; - p++; - } else { - p->ch = '.'; - p->style = MOD_ABNORMAL; - p++; - } + if ( ( utf8_display && g_unichar_isprint (c) ) || + ( utf8_display == 0 && is_printable (c) ) ) { + p->ch = c; + p++; + } else { + p->ch = '.'; + p->style = MOD_ABNORMAL; + p++; + } } else { if ( g_unichar_isprint (c) ) { p->ch = c; diff --git a/edit/editkeys.c b/edit/editkeys.c index 1d9463b34..a17c8d6c7 100644 --- a/edit/editkeys.c +++ b/edit/editkeys.c @@ -298,7 +298,6 @@ edit_translate_key (WEdit *edit, long x_key, int *cmd, int *ch) /* 8-bit source */ } else { - edit->charbuf[edit->charpoint + 1] = '\0'; int res = str_is_valid_char (edit->charbuf, edit->charpoint); if (res < 0) { if (res != -2) { @@ -312,10 +311,8 @@ edit_translate_key (WEdit *edit, long x_key, int *cmd, int *ch) c = convert_from_utf_to_current ( edit->charbuf ); edit->charbuf[0] = '\0'; edit->charpoint = 0; - if (is_printable (c)) { - char_for_insertion = c; - goto fin; - } + char_for_insertion = c; + goto fin; } /* unprinteble utf input, skip it */ edit->charbuf[0] = '\0';