summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2011-08-20 10:31:41 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2011-08-20 10:31:41 +0100
commitba32be4bb710ddbe28ad84c11c2b975d7f874ab4 (patch)
treee2355efa751692934b191f40503692ec8a4b806f /alot
parent5b9e0b1ba3495d1498022c5ea06e4981e1a09a1e (diff)
make editors write encoding user configurable
this defaults to 'UTF-8'
Diffstat (limited to 'alot')
-rw-r--r--alot/command.py3
-rw-r--r--alot/settings.py1
2 files changed, 3 insertions, 1 deletions
diff --git a/alot/command.py b/alot/command.py
index 2b6bc30a..d6eef770 100644
--- a/alot/command.py
+++ b/alot/command.py
@@ -754,7 +754,8 @@ class EnvelopeEditCommand(Command):
def openEnvelopeFromTmpfile():
f = open(tf.name)
- editor_input = f.read().decode('utf-8')
+ enc = settings.config.get('general', 'editor_writes_encoding')
+ editor_input = f.read().decode(enc)
#split editor out
headertext, bodytext = editor_input.split('\n\n', 1)
diff --git a/alot/settings.py b/alot/settings.py
index f8e9ca7e..55b543a3 100644
--- a/alot/settings.py
+++ b/alot/settings.py
@@ -28,6 +28,7 @@ DEFAULTS = {
'general': {
'colourmode': '256',
'editor_cmd': "/usr/bin/vim -f -c 'set filetype=mail' +",
+ 'editor_writes_encoding': 'UTF-8',
'terminal_cmd': 'x-terminal-emulator -e',
'spawn_editor': 'False',
'displayed_headers': 'From,To,Cc,Bcc,Subject',