After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 577877 - Add a feature to set default character encoding
Add a feature to set default character encoding
Status: RESOLVED DUPLICATE of bug 108711
Product: gnome-terminal
Classification: Core
Component: Profiles
git master
Other All
: Normal minor
: ---
Assigned To: GNOME Terminal Maintainers
GNOME Terminal Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-04-03 20:06 UTC by Heikki Orsila
Modified: 2009-04-05 13:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Default character encoding patch (2.66 KB, patch)
2009-04-03 20:06 UTC, Heikki Orsila
none Details | Review

Description Heikki Orsila 2009-04-03 20:06:06 UTC
gnome-terminal does not allow setting a default character encoding. This patch allows expert users to set the default encoding with gconf tool. Existing users are not affected by applying this patch.


Other information:
Comment 1 Heikki Orsila 2009-04-03 20:06:42 UTC
Created attachment 132030 [details] [review]
Default character encoding patch
Comment 2 Christian Persch 2009-04-03 20:20:50 UTC
That belongs to bug 108711; please attach further patches there.

Quick review of the patch:

+/*
+ * Set default character encoding, if one is set. One can set the default
+ * by editing
+ * /apps/gnome-terminal/profiles/Default/default_encoding with gconf
+ */
+static void
+terminal_screen_encoding(VteTerminal *terminal)
+{
+  GConfClient *conf;
+  gchar *charset;
+
+  conf = gconf_client_get_default ();
+  charset = gconf_client_get_string (conf, CONF_PROFILES_PREFIX"/Default/default_encoding", NULL);
+  if (charset != NULL)
+    vte_terminal_set_encoding (terminal, charset);
+  g_object_unref(conf);
+  g_free(charset);
+}

This is not how this should be implemented. The setting belongs in TerminalProfile, and TerminalScreen should only observe it. And when doing so, you need to take bug 108711 comment 2 into account.

*** This bug has been marked as a duplicate of 108711 ***
Comment 3 Heikki Orsila 2009-04-05 12:06:42 UTC
I'm not sure what you mean, and I have to admit I'm not familiar with the code either. Could you be so kind and implement the feature in a proper way? Would it take too much effort?
Comment 4 Christian Persch 2009-04-05 13:02:12 UTC
I mean that the patch is doing it wrongly. Profile specific settings code belongs in TerminalProfile only, and TerminalScreen adapts to these settings.

It wouldn't be very much effort to implement this for someone familiar with the code base.