mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
Fix encoding of newly created files in editor
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
parent
dd319ef92e
commit
e9a644219a
@ -564,6 +564,9 @@ edit_load_file (WEdit *edit)
|
||||
/* If fast load was used, the number of lines wasn't calculated */
|
||||
edit->total_lines = edit_count_lines (edit, 0, edit->last_byte);
|
||||
} else {
|
||||
#ifdef HAVE_CHARSET
|
||||
const char *codepage_id;
|
||||
#endif
|
||||
edit->last_byte = 0;
|
||||
if (*edit->filename) {
|
||||
edit->stack_disable = 1;
|
||||
@ -573,6 +576,11 @@ edit_load_file (WEdit *edit)
|
||||
}
|
||||
edit->stack_disable = 0;
|
||||
}
|
||||
#ifdef HAVE_CHARSET
|
||||
codepage_id = get_codepage_id( source_codepage );
|
||||
if ( codepage_id )
|
||||
edit->utf8 = str_isutf8 ( codepage_id );
|
||||
#endif
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user