More codecs conversion for i18n scripts
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 9 Jul 2009 03:13:15 +0000 (03:13 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 9 Jul 2009 03:13:15 +0000 (03:13 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@13550 dcc99617-32d9-48b4-a31d-7c20da2025e4

build/i18n/scripts/db-seed-i18n.py
build/i18n/scripts/fieldmapper.py

index d8bd36f..7f34194 100755 (executable)
@@ -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:
index e626d93..385fce5 100755 (executable)
@@ -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)