[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#127405: latest python2.1-xml breaks boot-floppies build system.



> >   outfile.write ('    "%s",\n' % e.convert(lang.name).encode('utf-8'))
> > 
> >   but according to the code, you'll have to do this only if you want
> >   to convert. So, if it were me, I would separate the 2 cases.

The following is a patch to work around this, but it will only work for UTF-8,
I believe.

Index: utilities/dbootstrap/langs/dumper.py
===================================================================
RCS file: /home/dancer/debian-boot/localcvs/boot-floppies-dancer/utilities/dbootstrap/langs/dumper.py,v
retrieving revision 1.1.1.1
diff -u -u -r1.1.1.1 dumper.py
--- utilities/dbootstrap/langs/dumper.py	2001/12/10 06:29:22	1.1.1.1
+++ utilities/dbootstrap/langs/dumper.py	2002/01/03 02:50:33
@@ -40,7 +40,7 @@
 
 def dump_list_c (outfile, engine, storage, items, lists, name, list):
     outfile.write ('static struct language_list %s = {\n' % name)
-    outfile.write ('  "%s",\n' % engine.convert (list.name))
+    outfile.write ('  "%s",\n' % engine.convert (list.name).encode('utf-8'))
     outfile.write ('  {\n')
 
     for i in range (len (list.items)):
@@ -98,10 +98,10 @@
 
         outfile.write ('  {\n')
         outfile.write ('    "%s",\n' % lang.ename)
-        outfile.write ('    "%s",\n' % e.convert (lang.name))
+        outfile.write ('    "%s",\n' % e.convert (lang.name).encode('utf-8'))
         outfile.write ('    NULL,\n')
         outfile.write ('    NULL,\n')
-        outfile.write ('    "%s",\n' % e.convert (lang.hint))
+        outfile.write ('    "%s",\n' % e.convert (lang.hint).encode('utf-8'))
         outfile.write ('    NULL\n')
         outfile.write ('  },\n')
 
@@ -112,7 +112,7 @@
 
     for lang in what:
         if do_convert:
-            e = engine ('UTF-8', lang.charset)
+            e = engine ('utf-8', lang.charset)
         else:
             e = do_not_convert ()
 
@@ -122,7 +122,7 @@
 
     for e, item in items:
         outfile.write ('  {\n')
-        outfile.write ('    "%s",\n' % e.convert (item.name))
+        outfile.write ('    "%s",\n' % e.convert (item.name).encode('utf-8'))
         outfile.write ('    NULL,\n')
         outfile.write ('    NULL,\n')
         outfile.write ('    NULL,\n')



-- 
dancer@debian.org : Junichi Uekawa   http://www.netfort.gr.jp/~dancer
GPG Fingerprint : 17D6 120E 4455 1832 9423  7447 3059 BF92 CD37 56F4



Reply to: