mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +03:00
add source_codepage to ini file, change mechanism (ctrl-t) of selection codepage
if codepage selected then this is source codepage and must be convert to utf-8
This commit is contained in:
parent
f845e4b569
commit
d004658a1d
@ -93,21 +93,16 @@ int
|
||||
do_select_codepage (void)
|
||||
{
|
||||
const char *errmsg;
|
||||
int r;
|
||||
|
||||
if (display_codepage > 0) {
|
||||
source_codepage = select_charset (source_codepage, 0);
|
||||
errmsg =
|
||||
init_translation_table (source_codepage, display_codepage);
|
||||
if (errmsg) {
|
||||
message (D_ERROR, MSG_ERROR, "%s", errmsg);
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
message (D_ERROR, _("Warning"),
|
||||
_("To use this feature select your codepage in\n"
|
||||
"Setup / Display Bits dialog!\n"
|
||||
"Do not forget to save options."));
|
||||
return -1;
|
||||
r = select_charset (source_codepage, 0);
|
||||
if ( r > 0 )
|
||||
source_codepage = r;
|
||||
|
||||
errmsg = init_translation_table (source_codepage, display_codepage);
|
||||
if (errmsg) {
|
||||
message (D_ERROR, MSG_ERROR, "%s", errmsg);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -378,6 +378,8 @@ save_setup (void)
|
||||
#ifdef HAVE_CHARSET
|
||||
save_string( "Misc", "display_codepage",
|
||||
get_codepage_id( display_codepage ), profile_name );
|
||||
save_string( "Misc", "source_codepage",
|
||||
get_codepage_id( source_codepage ), profile_name );
|
||||
#endif /* HAVE_CHARSET */
|
||||
|
||||
g_free (profile);
|
||||
@ -581,8 +583,11 @@ load_setup (void)
|
||||
cpname, sizeof(cpname) );
|
||||
if ( cpname[0] != '\0' )
|
||||
display_codepage = get_codepage_index( cpname );
|
||||
load_string( "Misc", "source_codepage", "",
|
||||
cpname, sizeof(cpname) );
|
||||
if ( cpname[0] != '\0' )
|
||||
source_codepage = get_codepage_index( cpname );
|
||||
}
|
||||
|
||||
init_translation_table( source_codepage, display_codepage );
|
||||
#endif /* HAVE_CHARSET */
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user