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,14 +485,15 @@ edit_draw_this_line (WEdit *edit, long b, long row, long start_col,
break; break;
} }
if (!edit->utf8) { if (!edit->utf8) {
if (is_printable (c)) { if ( ( utf8_display && g_unichar_isprint (c) ) ||
p->ch = c; ( utf8_display == 0 && is_printable (c) ) ) {
p++; p->ch = c;
} else { p++;
p->ch = '.'; } else {
p->style = MOD_ABNORMAL; p->ch = '.';
p++; p->style = MOD_ABNORMAL;
} p++;
}
} else { } else {
if ( g_unichar_isprint (c) ) { if ( g_unichar_isprint (c) ) {
p->ch = c; p->ch = c;

View File

@ -298,7 +298,6 @@ edit_translate_key (WEdit *edit, long x_key, int *cmd, int *ch)
/* 8-bit source */ /* 8-bit source */
} else { } else {
edit->charbuf[edit->charpoint + 1] = '\0';
int res = str_is_valid_char (edit->charbuf, edit->charpoint); int res = str_is_valid_char (edit->charbuf, edit->charpoint);
if (res < 0) { if (res < 0) {
if (res != -2) { 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 ); c = convert_from_utf_to_current ( edit->charbuf );
edit->charbuf[0] = '\0'; edit->charbuf[0] = '\0';
edit->charpoint = 0; edit->charpoint = 0;
if (is_printable (c)) { char_for_insertion = c;
char_for_insertion = c; goto fin;
goto fin;
}
} }
/* unprinteble utf input, skip it */ /* unprinteble utf input, skip it */
edit->charbuf[0] = '\0'; edit->charbuf[0] = '\0';