[meld/meld-3-16] Fix saving of text created in blank comparison (bgo#771498)
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld/meld-3-16] Fix saving of text created in blank comparison (bgo#771498)
- Date: Sat, 17 Sep 2016 21:06:26 +0000 (UTC)
commit 6ac663a2ebe6eb0dff0e6ebecb4513d407ec4db6
Author: Vasily Galkin <galkin-vv ya ru>
Date: Sat Sep 17 12:08:33 2016 +0300
Fix saving of text created in blank comparison (bgo#771498)
meld/filediff.py | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/meld/filediff.py b/meld/filediff.py
index c68f48d..0bde620 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -1494,6 +1494,9 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
text = text_type(buf.get_text(start, end, False), 'utf8')
source_encoding = bufdata.sourcefile.get_encoding()
+ if not source_encoding:
+ # no encoding for new blank comparison
+ source_encoding = GtkSource.Encoding.get_utf8()
while isinstance(text, unicode):
try:
encoding = source_encoding.get_charset()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]