[open-ils-commits] r13550 - trunk/build/i18n/scripts (dbs)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Jul 8 23:13:17 EDT 2009


Author: dbs
Date: 2009-07-08 23:13:15 -0400 (Wed, 08 Jul 2009)
New Revision: 13550

Modified:
   trunk/build/i18n/scripts/db-seed-i18n.py
   trunk/build/i18n/scripts/fieldmapper.py
Log:
More codecs conversion for i18n scripts

Modified: trunk/build/i18n/scripts/db-seed-i18n.py
===================================================================
--- trunk/build/i18n/scripts/db-seed-i18n.py	2009-07-09 03:06:20 UTC (rev 13549)
+++ trunk/build/i18n/scripts/db-seed-i18n.py	2009-07-09 03:13:15 UTC (rev 13550)
@@ -152,7 +152,7 @@
         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:

Modified: trunk/build/i18n/scripts/fieldmapper.py
===================================================================
--- trunk/build/i18n/scripts/fieldmapper.py	2009-07-09 03:06:20 UTC (rev 13549)
+++ trunk/build/i18n/scripts/fieldmapper.py	2009-07-09 03:13:15 UTC (rev 13550)
@@ -18,6 +18,7 @@
 # GNU General Public License for more details.
 
 import basel10n
+import codecs
 import optparse
 import polib
 import sys
@@ -182,7 +183,7 @@
         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 @@
     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)



More information about the open-ils-commits mailing list