editor: force UTF-8

This commit is contained in:
Florian Bruhin 2014-05-27 11:30:39 +02:00
parent 89a507a0bb
commit c65ebc81da

View File

@ -70,7 +70,7 @@ class ExternalEditor(QObject):
message.error("Editor did quit abnormally (status {})!".format(
exitcode))
return
with open(self.filename, 'r') as f:
with open(self.filename, 'r', encoding='utf-8') as f:
text = ''.join(f.readlines())
logger.debug("Read back: {}".format(text))
self.editing_finished.emit(text)
@ -106,7 +106,7 @@ class ExternalEditor(QObject):
self.text = text
self.oshandle, self.filename = mkstemp(text=True)
if text:
with open(self.filename, 'w') as f:
with open(self.filename, 'w', encoding='utf-8') as f:
f.write(text)
self.proc = QProcess(self)
self.proc.finished.connect(self.on_proc_closed)