mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
fix: draw in core editor 8-bit locale and UTF-8 source
This commit is contained in:
parent
1d3c9e1742
commit
990838a226
@ -300,7 +300,7 @@ print_to_widget (WEdit *edit, long row, int start_col, int start_col_real,
|
||||
lowlevel_set_color (color);
|
||||
}
|
||||
}
|
||||
#ifndef HAVE_SLANG
|
||||
if ( textchar > 255 ) {
|
||||
int res = g_unichar_to_utf8 (textchar, str);
|
||||
if ( res == 0 ) {
|
||||
str[0] = '.';
|
||||
@ -309,9 +309,9 @@ print_to_widget (WEdit *edit, long row, int start_col, int start_col_real,
|
||||
str[res] = '\0';
|
||||
}
|
||||
addstr (str);
|
||||
#else
|
||||
addch (textchar);
|
||||
#endif
|
||||
} else {
|
||||
addch(textchar);
|
||||
}
|
||||
p++;
|
||||
}
|
||||
}
|
||||
|
@ -351,7 +351,7 @@ convert_from_utf_to_current_c (const int input_char)
|
||||
if ( res == 0 ) {
|
||||
return ch;
|
||||
}
|
||||
str[6] = '\0';
|
||||
str[res] = '\0';
|
||||
|
||||
const char *cp_from = get_codepage_id ( source_codepage );
|
||||
conv = str_crt_conv_from ( cp_from );
|
||||
|
Loading…
Reference in New Issue
Block a user