if not options.outfile:
outfile = sys.stdout
else:
- outfile = open(options.outfile, 'w')
+ outfile = codecs.open(options.outfile, encoding='utf-8', mode='w')
for insert in pot.sql:
outfile.write(insert + "\n")
else:
# GNU General Public License for more details.
import basel10n
+import codecs
import optparse
import polib
import sys
pot.loadpo(options.entity)
pot.create_entity()
if options.outfile:
- outfile = open(options.outfile, 'w')
+ outfile = codecs.open(options.outfile, encoding='utf-8', mode='w')
for entity in pot.definitions:
outfile.write(entity + "\n")
else:
elif options.convert:
pot.get_strings(options.convert)
if options.outfile:
- outfile = open(options.outfile, 'w')
+ outfile = codecs.open(options.outfile, encoding='utf-8', mode='w')
outfile.write(pot.idl)
else:
sys.stdout.write(pot.idl)