diff -aur alacarte-3.7.3/Alacarte/MenuEditor.py alacarte-3.7.3.new/Alacarte/MenuEditor.py --- alacarte-3.7.3/Alacarte/MenuEditor.py 2013-01-11 02:50:22.000000000 +0200 +++ alacarte-3.7.3.new/Alacarte/MenuEditor.py 2013-01-21 12:12:43.338832019 +0200 @@ -21,6 +21,7 @@ import xml.dom.minidom import xml.parsers.expat from gi.repository import GMenu, GLib +from xml.dom.ext import PrettyPrint from Alacarte import util def get_default_menu(): @@ -54,7 +55,7 @@ def save(self): with codecs.open(self.path, 'w', 'utf8') as f: - f.write(self.dom.toprettyxml()) + PrettyPrint(self.dom, stream=f) def restoreToSystem(self): self.restoreTree(self.tree.get_root_directory()) @@ -262,6 +263,7 @@ out_path = os.path.join(util.getUserItemPath(), file_id) contents, length = keyfile.to_data() + contents = unicode(contents, 'utf8') with codecs.open(out_path, 'w', 'utf8') as f: f.write(contents) @@ -402,6 +404,7 @@ file_id = util.getUniqueFileId(keyfile.get_string(GLib.KEY_FILE_DESKTOP_GROUP, 'Name'), '.desktop') contents, length = keyfile.to_data() + contents = unicode(contents, 'utf8') path = os.path.join(util.getUserItemPath(), file_id) with codecs.open(path, 'w', 'utf8') as f: @@ -424,6 +427,7 @@ util.fillKeyFile(keyfile, kwargs) contents, length = keyfile.to_data() + contents = unicode(contents, 'utf8') path = os.path.join(util.getUserDirectoryPath(), file_id) with codecs.open(path, 'w', 'utf8') as f: