Skip to content

Commit f2ada66

Browse files
committed
ts2appinfo.py: get desktop encoding right
1 parent ff41882 commit f2ada66

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

scripts/ts2appinfo.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585

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

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

9090
for line in lines:
9191
skip = False
@@ -97,10 +97,7 @@
9797
t = line.strip()[len(prefix) + 1:]
9898
for lang in strings[t]:
9999
l = "{}[{}]={}\n".format(prefix, lang, strings[t][lang])
100-
try:
101-
f.write(l.decode("utf-8"))
102-
except AttributeError:
103-
f.write(l)
100+
f.write(l)
104101

105102
elif line.startswith(prefix + "["):
106103
skip = True

0 commit comments

Comments
 (0)