mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +03:00
fix: incorrect show and input capitalize chars in UTF-8 locale and 8-bit source
This commit is contained in:
parent
cc54a2083b
commit
202ec6d78f
@ -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;
|
||||||
|
@ -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';
|
||||||
|
Loading…
Reference in New Issue
Block a user