fix: incorrect show and input capitalize chars in UTF-8 locale and 8-bit source

This commit is contained in:
Ilia Maslakov 2009-04-20 14:46:22 +00:00
parent cc54a2083b
commit 202ec6d78f
2 changed files with 11 additions and 13 deletions

View File

@ -485,7 +485,8 @@ edit_draw_this_line (WEdit *edit, long b, long row, long start_col,
break;
}
if (!edit->utf8) {
if (is_printable (c)) {
if ( ( utf8_display && g_unichar_isprint (c) ) ||
( utf8_display == 0 && is_printable (c) ) ) {
p->ch = c;
p++;
} else {

View File

@ -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,11 +311,9 @@ 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;
}
}
/* unprinteble utf input, skip it */
edit->charbuf[0] = '\0';
edit->charpoint = 0;