Properly decode lines in targets.android.TargetAndroid._update_libraries_references

This commit is contained in:
Robert Niederreiter 2017-10-11 12:44:30 +02:00
parent 827f943698
commit 075e11ab3b

View file

@ -850,10 +850,11 @@ class TargetAndroid(Target):
# recreate the project.properties # recreate the project.properties
with io.open(project_fn, 'w', encoding='utf-8') as fd: with io.open(project_fn, 'w', encoding='utf-8') as fd:
try: lines = [
fd.writelines((line.encode('utf-8') for line in content)) line if isinstance(line, unicode) else line.decode('utf-8')
except: for line in content
fd.writelines(content) ]
fd.writelines(lines)
if not content[-1].endswith(u'\n'): if not content[-1].endswith(u'\n'):
fd.write(u'\n') fd.write(u'\n')
for index, ref in enumerate(references): for index, ref in enumerate(references):