Fix encoding of newly created files in editor

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
Slava Zanko 2009-06-02 17:46:11 +03:00
parent dd319ef92e
commit e9a644219a

View File

@ -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;
}