editor: force UTF-8
This commit is contained in:
parent
89a507a0bb
commit
c65ebc81da
@ -70,7 +70,7 @@ class ExternalEditor(QObject):
|
|||||||
message.error("Editor did quit abnormally (status {})!".format(
|
message.error("Editor did quit abnormally (status {})!".format(
|
||||||
exitcode))
|
exitcode))
|
||||||
return
|
return
|
||||||
with open(self.filename, 'r') as f:
|
with open(self.filename, 'r', encoding='utf-8') as f:
|
||||||
text = ''.join(f.readlines())
|
text = ''.join(f.readlines())
|
||||||
logger.debug("Read back: {}".format(text))
|
logger.debug("Read back: {}".format(text))
|
||||||
self.editing_finished.emit(text)
|
self.editing_finished.emit(text)
|
||||||
@ -106,7 +106,7 @@ class ExternalEditor(QObject):
|
|||||||
self.text = text
|
self.text = text
|
||||||
self.oshandle, self.filename = mkstemp(text=True)
|
self.oshandle, self.filename = mkstemp(text=True)
|
||||||
if text:
|
if text:
|
||||||
with open(self.filename, 'w') as f:
|
with open(self.filename, 'w', encoding='utf-8') as f:
|
||||||
f.write(text)
|
f.write(text)
|
||||||
self.proc = QProcess(self)
|
self.proc = QProcess(self)
|
||||||
self.proc.finished.connect(self.on_proc_closed)
|
self.proc.finished.connect(self.on_proc_closed)
|
||||||
|
Loading…
Reference in New Issue
Block a user