write po files as utf8
offlate/systems/tp.py
43 | 43 | def getpo(self): | |
44 | 44 | pofile = requests.get('https://translationproject.org/PO-files/' + self.lang + '/' + self.filename) | |
45 | 45 | 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')) | |
48 | 48 | else: | |
49 | 49 | shutil.copy(self.potpath, self.popath) | |
50 | 50 | ||
51 | 51 | def getpot(self): | |
52 | - | with open(self.potpath, 'w') as f: | |
52 | + | with open(self.potpath, 'wb') as f: | |
53 | 53 | potfile = requests.get('http://translationproject.org/POT-files/' | |
54 | 54 | + self.name + '-' + self.version + '.pot') | |
55 | - | f.write(potfile.text) | |
55 | + | f.write(potfile.text.encode('utf-8')) | |
56 | 56 | ||
57 | 57 | def updateGettextNames(self): | |
58 | 58 | self.popath = self.basedir + '/' + self.filename |