1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 02:00:45 +00:00

target: Make sure xml is encoded properly before writing to file

Some UI elements can contain non ASCII characters so ensure we encode the
output to utf-8 before writing to file.
This commit is contained in:
Marc Bonnici 2018-04-20 10:05:50 +01:00 committed by setrofim
parent 87b235638a
commit 58c0d30b26

View File

@ -1188,7 +1188,7 @@ class AndroidTarget(Target):
parsed_xml = xml.dom.minidom.parse(filepath)
with open(filepath, 'w') as f:
f.write(parsed_xml.toprettyxml())
f.write(parsed_xml.toprettyxml().encode('utf-8'))
def is_installed(self, name):
return super(AndroidTarget, self).is_installed(name) or self.package_is_installed(name)