Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions android2po/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ def xml2string(tree, action):
"""
ENCODING = 'utf-8'
dom = convert.write_xml(tree, warnfunc=action.message)
return etree.tostring(dom, xml_declaration=True,
encoding=ENCODING, pretty_print=True).decode('utf-8')
etree.indent(dom, space=" ")
return etree.tostring(dom, xml_declaration=False,
doctype='<?xml version="1.0" encoding="' + ENCODING + '"?>',
encoding=ENCODING, pretty_print=True).decode(ENCODING)


def read_xml(action, filename, **kw):
Expand Down Expand Up @@ -429,7 +431,7 @@ def execute(self):
# This will make us pick up the language on subsequent runs.
for kind in self.env.xmlfiles:
if write_file(self, language.xml(kind),
"""<?xml version='1.0' encoding='utf-8'?>\n<resources>\n</resources>""",
"""<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n</resources>""",
update=False, ignore_exists=show_exists):
something_done = True

Expand Down
Loading