mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +03:00
fix incorrect draw utf-8 text in 8-bit locale
This commit is contained in:
parent
42eba5c18c
commit
8767909493
@ -434,10 +434,10 @@ edit_draw_this_line (WEdit *edit, long b, long row, long start_col,
|
||||
default:
|
||||
if ( utf8_display ) {
|
||||
if ( !edit->utf8 ) {
|
||||
//c = convert_from_utf_to_current_c (c);
|
||||
}
|
||||
} else {
|
||||
if ( edit->utf8 ) {
|
||||
c = convert_from_utf_to_current_c (c);
|
||||
//c = convert_to_utf (c);
|
||||
} else {
|
||||
c = convert_to_display_c (c);
|
||||
|
@ -284,14 +284,19 @@ convert_from_utf_to_current (const char *str)
|
||||
unsigned char
|
||||
convert_from_utf_to_current_c (const int input_char)
|
||||
{
|
||||
unsigned char str[2];
|
||||
unsigned char str[6 + 1];
|
||||
unsigned char ch = '.';
|
||||
|
||||
char *cp_to = NULL;
|
||||
GIConv conv;
|
||||
GString *translated_data;
|
||||
int res = 0;
|
||||
|
||||
str[0] = input_char;
|
||||
str[1] = '\0';
|
||||
res = g_unichar_to_utf8 (input_char, str);
|
||||
if ( res == 0 ) {
|
||||
return ch;
|
||||
}
|
||||
str[6] = '\0';
|
||||
|
||||
translated_data = g_string_new ("");
|
||||
cp_to = g_strdup ( get_codepage_id ( display_codepage ) );
|
||||
|
Loading…
Reference in New Issue
Block a user