[meld] filediff: If lacking any encoding, just save as UTF-8
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] filediff: If lacking any encoding, just save as UTF-8
- Date: Sun, 25 Oct 2015 21:31:37 +0000 (UTC)
commit d408a6960a27f49a1c2416bb0c4cfa4b4fb2599b
Author: Kai Willadsen <kai willadsen gmail com>
Date: Mon Oct 26 07:17:55 2015 +1000
filediff: If lacking any encoding, just save as UTF-8
This will happen if e.g., there was an error loading the file from disk.
meld/filediff.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/meld/filediff.py b/meld/filediff.py
index 59ac13f..f695509 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -1588,7 +1588,7 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
text = text.replace('\n', k)
break
- encoding = bufdata.encoding
+ encoding = bufdata.encoding or 'utf-8'
while isinstance(text, unicode):
try:
text = text.encode(encoding)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]