diff --git a/terminatorlib/preferences.glade b/terminatorlib/preferences.glade
index 74eae78b..d741d0cc 100644
--- a/terminatorlib/preferences.glade
+++ b/terminatorlib/preferences.glade
@@ -263,6 +263,14 @@
+
5
diff --git a/terminatorlib/prefseditor.py b/terminatorlib/prefseditor.py
index f60259b4..70796a85 100755
--- a/terminatorlib/prefseditor.py
+++ b/terminatorlib/prefseditor.py
@@ -14,6 +14,7 @@ from util import dbg, err
import config
from keybindings import Keybindings, KeymapError
from translation import _
+from encoding import TerminatorEncoding
from terminator import Terminator
from plugin import PluginRegistry
@@ -499,6 +500,23 @@ class PrefsEditor:
widget.set_active(3)
else:
widget.set_active(0)
+ # Encoding
+ rowiter = None
+ widget = guiget('encoding_combobox')
+ encodingstore = guiget('EncodingListStore')
+ value = self.config['encoding']
+ encodings = TerminatorEncoding().get_list()
+ encodings.sort(lambda x, y: cmp(x[2].lower(), y[2].lower()))
+
+ for encoding in encodings:
+ if encoding[1] is None:
+ continue
+
+ label = "%s %s" % (encoding[2], encoding[1])
+ rowiter = encodingstore.append([label, encoding[1]])
+
+ if encoding[1] == value:
+ widget.set_active_iter(rowiter)
def set_layout(self, layout_name):
"""Set a layout"""
@@ -607,6 +625,15 @@ class PrefsEditor:
self.config['backspace_binding'] = value
self.config.save()
+ def on_encoding_combobox_changed(self, widget):
+ """Encoding setting changed"""
+ selected = widget.get_active_iter()
+ liststore = widget.get_model()
+ value = liststore.get_value(selected, 1)
+
+ self.config['encoding'] = value
+ self.config.save()
+
def on_scrollback_lines_spinbutton_value_changed(self, widget):
"""Scrollback lines setting changed"""
value = widget.get_value_as_int()