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

@ -1384,7 +1384,7 @@ def write_metadata(metadatapath, app):
raise MetaDataException('Cannot write "%s", not an accepted format, use: %s' % (
metadatapath, ', '.join(accepted)))
with open(metadatapath, 'w') as mf:
with open(metadatapath, 'w', encoding='utf8') as mf:
if ext == 'txt':
return write_txt(mf, app)
elif ext == 'yml':