mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 01:54:24 +03:00
(edit_draw_this_line): fix printable character recognition in 8-bit locales when displaying UTF-8
Signed-off-by: Andrew Borodin <aborodin@vmail.ru> Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
This commit is contained in:
parent
c079a09612
commit
f4ef5c64a4
@ -573,6 +573,7 @@ edit_draw_this_line (WEdit *edit, off_t b, long row, long start_col, long end_co
|
||||
unsigned int c;
|
||||
gboolean wide_width_char = FALSE;
|
||||
gboolean control_char = FALSE;
|
||||
gboolean printable;
|
||||
|
||||
p->ch = 0;
|
||||
p->style = q == edit->buffer.curs1 ? MOD_CURSOR : 0;
|
||||
@ -759,34 +760,30 @@ edit_draw_this_line (WEdit *edit, off_t b, long row, long start_col, long end_co
|
||||
control_char = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef HAVE_CHARSET
|
||||
if (edit->utf8)
|
||||
{
|
||||
if (g_unichar_isprint (c))
|
||||
p->ch = c;
|
||||
if (mc_global.utf8_display)
|
||||
/* c is gunichar */
|
||||
printable = g_unichar_isprint (c);
|
||||
else
|
||||
{
|
||||
p->ch = '.';
|
||||
p->style = abn_style;
|
||||
}
|
||||
p++;
|
||||
/* c was gunichar; now c is 8-bit char converted from gunichar */
|
||||
printable = is_printable (c);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if ((mc_global.utf8_display && g_unichar_isprint (c)) ||
|
||||
(!mc_global.utf8_display && is_printable (c)))
|
||||
{
|
||||
/* c is 8-bit char */
|
||||
printable = is_printable (c);
|
||||
|
||||
if (printable)
|
||||
p->ch = c;
|
||||
p++;
|
||||
}
|
||||
else
|
||||
{
|
||||
p->ch = '.';
|
||||
p->style = abn_style;
|
||||
}
|
||||
p++;
|
||||
}
|
||||
}
|
||||
col++;
|
||||
break;
|
||||
} /* case */
|
||||
|
Loading…
Reference in New Issue
Block a user