From: dbs Date: Thu, 9 Jul 2009 03:13:15 +0000 (+0000) Subject: More codecs conversion for i18n scripts X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=c2b60f33b16b09850cf7269abc749631386c0b22;p=evergreen%2Fmasslnc.git More codecs conversion for i18n scripts git-svn-id: svn://svn.open-ils.org/ILS/trunk@13550 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/build/i18n/scripts/db-seed-i18n.py b/build/i18n/scripts/db-seed-i18n.py index d8bd36febe..7f3419461a 100755 --- a/build/i18n/scripts/db-seed-i18n.py +++ b/build/i18n/scripts/db-seed-i18n.py @@ -152,7 +152,7 @@ def main(): 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: diff --git a/build/i18n/scripts/fieldmapper.py b/build/i18n/scripts/fieldmapper.py index e626d9308c..385fce5182 100755 --- a/build/i18n/scripts/fieldmapper.py +++ b/build/i18n/scripts/fieldmapper.py @@ -18,6 +18,7 @@ Requires polib from http://polib.googlecode.com # GNU General Public License for more details. import basel10n +import codecs import optparse import polib import sys @@ -182,7 +183,7 @@ def main(): 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: @@ -192,7 +193,7 @@ def main(): 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)