Commit d408a696 authored by Kai Willadsen's avatar Kai Willadsen

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.
parent cbcfc000
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment