add in core viewer codepage selection from list

Author: Ilia Maslakov <il.smind@gmail.com>
This commit is contained in:
Slava Zanko 2009-04-16 12:34:38 +03:00
parent 7658246c35
commit 6771a00b4c

View File

@ -3652,12 +3652,13 @@ static void view_cmk_moveto_bottom (void *w, int n) {
static void static void
view_select_encoding (WView *view) view_select_encoding (WView *view)
{ {
char *enc; char *enc = NULL;
GIConv conv; GIConv conv;
struct cache_line *line; struct cache_line *line;
enc = input_dialog ("Encoding", "Paste encoding", NULL, ""); do_select_codepage ();
enc = g_strdup( get_codepage_id ( source_codepage ) );
if (enc != NULL) { if (enc != NULL) {
conv = str_crt_conv_from (enc); conv = str_crt_conv_from (enc);
if (conv != (iconv_t)(-1)) { if (conv != (iconv_t)(-1)) {
@ -3667,7 +3668,9 @@ view_select_encoding (WView *view)
line = view_offset_to_line (view, view->dpy_start); line = view_offset_to_line (view, view->dpy_start);
view_set_first_showed (view, line); view_set_first_showed (view, line);
} }
g_free(enc);
} }
} }