paraparser.py: fix unichar py33
authorrobin
Wed, 20 Nov 2013 15:50:15 +0000
branchpy33
changeset 3809 cbd390e6d557
parent 3808 11feb32dd300
child 3810 b8e806bdcfb8
paraparser.py: fix unichar
src/reportlab/platypus/paraparser.py
--- a/src/reportlab/platypus/paraparser.py	Wed Nov 20 15:49:10 2013 +0000
+++ b/src/reportlab/platypus/paraparser.py	Wed Nov 20 15:50:15 2013 +0000
@@ -750,15 +750,15 @@
             if 'code' in attr:
                 self._syntax_error('<unichar/> invalid with both name and code attributes')
             try:
-                v = unicodedata.lookup(attr['name']).encode('utf8')
+                v = unicodedata.lookup(attr['name'])
             except KeyError:
-                self._syntax_error('<unichar/> invalid name attribute\n"%s"' % name)
+                self._syntax_error('<unichar/> invalid name attribute\n"%s"' % ascii(name))
                 v = '\0'
         elif 'code' in attr:
             try:
-                v = chr(int(eval(attr['code']))).encode('utf8')
+                v = chr(int(eval(attr['code'])))
             except:
-                self._syntax_error('<unichar/> invalid code attribute %s' % attr['code'])
+                self._syntax_error('<unichar/> invalid code attribute %s' % ascii(attr['code']))
                 v = '\0'
         else:
             v = None