diff -uNr gnome-terminal.orig/src/terminal-screen.c gnome-terminal/src/terminal-screen.c --- gnome-terminal.orig/src/terminal-screen.c 2004-11-29 10:40:19.000000000 +0100 +++ gnome-terminal/src/terminal-screen.c 2005-04-06 17:57:35.000000000 +0200 @@ -1162,7 +1162,7 @@ NULL, FALSE, FALSE, FALSE, NULL, NULL, NULL, dir, NULL, 1.0, - NULL, name, -1); + NULL, name, -1, NULL); g_free (name); } @@ -1180,7 +1180,7 @@ screen->priv->window, FALSE, FALSE, FALSE, NULL, NULL, NULL, dir, NULL, 1.0, - NULL, NULL, -1); + NULL, NULL, -1, NULL); } static void diff -uNr gnome-terminal.orig/src/terminal-window.c gnome-terminal/src/terminal-window.c --- gnome-terminal.orig/src/terminal-window.c 2005-03-01 00:27:11.000000000 +0100 +++ gnome-terminal/src/terminal-window.c 2005-04-06 17:59:37.000000000 +0200 @@ -85,6 +85,7 @@ * event-driven while GTK doesn't support _NET_WM_STATE_FULLSCREEN */ guint fullscreen : 1; + char *encoding; }; enum { @@ -2214,7 +2215,7 @@ screen, FALSE, FALSE, FALSE, NULL, NULL, NULL, dir, NULL, 1.0, - NULL, name, -1); + NULL, name, -1, NULL); } static void @@ -2240,7 +2241,7 @@ NULL, FALSE, FALSE, FALSE, NULL, NULL, NULL, dir, NULL, 1.0, - NULL, NULL, -1); + NULL, NULL, -1, NULL); } } diff -uNr gnome-terminal.orig/src/terminal.c gnome-terminal/src/terminal.c --- gnome-terminal.orig/src/terminal.c 2005-03-01 00:27:11.000000000 +0100 +++ gnome-terminal/src/terminal.c 2005-04-06 18:16:36.000000000 +0200 @@ -99,6 +99,7 @@ char *default_geometry; char *default_working_dir; char **post_execute_args; + char *default_encoding; } OptionParsingResults; static void sync_profile_list (gboolean use_this_list, @@ -166,6 +167,7 @@ OPTION_DEFAULT_WORKING_DIRECTORY, OPTION_ZOOM, OPTION_ACTIVE, + OPTION_SETENCODING, OPTION_COMPAT, OPTION_LAST }; @@ -369,6 +371,15 @@ N_("Set the last specified tab as the active one in its window"), N_("ZOOMFACTOR") }, + { + "encoding", + '\0', + POPT_ARG_STRING, + NULL, + OPTION_SETENCODING, + N_("Set terminal encoding (e.g. ISO-8859-2)"), + N_("ENCODING") + }, /* * Crappy old compat args @@ -1154,6 +1165,17 @@ it->active = TRUE; } break; + + case OPTION_SETENCODING: + { + + if (arg == NULL) { + g_printerr (_("Option \"%s\" requires an argument containing the character encoding (e.g. ISO-8859-2)\n"), "--encoding"); + } + + results->default_encoding = g_strdup (arg); + } + break; case OPTION_COMPAT: g_printerr (_("Option --%s is no longer supported in this version of gnome-terminal; you might want to create a profile with the desired setting, and use the new --window-with-profile option\n"), opt->longName); @@ -1444,7 +1466,8 @@ it->zoom : 1.0, results->startup_id, results->display_name, - results->screen_number); + results->screen_number, + results->default_encoding); current_window = g_list_last (app->windows)->data; } @@ -1462,7 +1485,8 @@ NULL, it->zoom_set ? it->zoom : 1.0, - NULL, NULL, -1); + NULL, NULL, -1, + NULL); } if (it->active) @@ -1895,7 +1919,8 @@ double zoom, const char *startup_id, const char *display_name, - int screen_number) + int screen_number, + const char *encoding) { TerminalScreen *screen; gboolean window_created; @@ -1978,6 +2003,15 @@ */ if (window_created) gtk_window_present (GTK_WINDOW (window)); + + if (encoding) { + GtkWidget *widget; + + widget = terminal_screen_get_widget (screen); + terminal_widget_set_encoding (widget, encoding); + + g_printerr (_("Setting encoding to: \"%s\"\n"), encoding); + } terminal_screen_launch_child (screen); } diff -uNr gnome-terminal.orig/src/terminal.h gnome-terminal/src/terminal.h --- gnome-terminal.orig/src/terminal.h 2004-10-31 03:32:39.000000000 +0100 +++ gnome-terminal/src/terminal.h 2005-04-06 18:00:35.000000000 +0200 @@ -53,7 +53,8 @@ double zoom, const char *startup_id, const char *display_name, - int screen_number); + int screen_number, + const char *encoding); void terminal_app_manage_profiles (TerminalApp *app, GtkWindow *transient_parent);