write po files as utf8

Julien LepillerWed Jun 20 23:27:54+0200 2018

7b20b58

write po files as utf8

offlate/systems/tp.py

4343
    def getpo(self):
4444
        pofile = requests.get('https://translationproject.org/PO-files/' + self.lang + '/' + self.filename)
4545
        if(pofile.status_code == 200):
46-
            with open(self.popath, 'w') as f:
47-
                f.write(pofile.text)
46+
            with open(self.popath, 'wb') as f:
47+
                f.write(pofile.text.encode('utf-8'))
4848
        else:
4949
            shutil.copy(self.potpath, self.popath)
5050
5151
    def getpot(self):
52-
        with open(self.potpath, 'w') as f:
52+
        with open(self.potpath, 'wb') as f:
5353
            potfile = requests.get('http://translationproject.org/POT-files/'
5454
                    + self.name + '-' + self.version + '.pot')
55-
            f.write(potfile.text)
55+
            f.write(potfile.text.encode('utf-8'))
5656
5757
    def updateGettextNames(self):
5858
        self.popath = self.basedir + '/' + self.filename