Skip to content

Commit

Permalink
ts2appinfo.py: get desktop encoding right
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Oct 1, 2018
1 parent ff41882 commit f2ada66
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions scripts/ts2appinfo.py
Expand Up @@ -85,7 +85,7 @@

d.write(sys.argv[1] + "/org.qgis.qgis.appdata.xml", encoding="UTF-8", xml_declaration=True)

f = open(sys.argv[1] + "/org.qgis.qgis.desktop", "w")
f = open(sys.argv[1] + "/org.qgis.qgis.desktop", "w", encoding="utf-8")

for line in lines:
skip = False
Expand All @@ -97,10 +97,7 @@
t = line.strip()[len(prefix) + 1:]
for lang in strings[t]:
l = "{}[{}]={}\n".format(prefix, lang, strings[t][lang])
try:
f.write(l.decode("utf-8"))
except AttributeError:
f.write(l)
f.write(l)

elif line.startswith(prefix + "["):
skip = True
Expand Down

0 comments on commit f2ada66

Please sign in to comment.