read/write F-Droid files always as UTF-8

This makes UTF-8 the sole supported encoding for F-Droid's files. This is
mostly codifying the already existing practice for config.py and index.xml.
The other files where always just ASCII before.

* config.py
* metadata/*.txt
* known_apks.txt
* categories.txt
* latestapps.txt
* latestapps.dat
* index.xml

Note: this does not change the read/write encoding of stats files.  That is
still ASCII.
This commit is contained in:
Hans-Christoph Steiner 2016-06-07 13:35:13 +02:00
parent 444e8ad982
commit afd528731a
5 changed files with 12 additions and 12 deletions

View file

@ -33,7 +33,7 @@ def proper_format(app):
s = io.StringIO()
# TODO: currently reading entire file again, should reuse first
# read in metadata.py
with open(app.metadatapath, 'r') as f:
with open(app.metadatapath, 'r', encoding='utf8') as f:
cur_content = f.read()
metadata.write_txt(s, app)
content = s.getvalue()