[reportlab-users] Unicode problem in para.py
Michael Egorov
michwill at gmail.com
Wed Sep 9 05:41:57 EDT 2009
I have unicode problem in para.py here:
elif standard.has_key(name):
fragment = standard[name]+fragment[semi+1:]
elif greeks.has_key(name):
fragment = greeks[name]+fragment[semi+1:] # just here
(line 2041)
It happens because greeks[name] is a string whether fragment is unicode.
String cannot be converted to unicode if you don't know the encoding.
To reproduce that you need any character from greeks in text for Para
The patch wich makes it working:
--- platypus/para.py (revision 3542)
+++ platypus/para.py (working copy)
@@ -2038,7 +2038,7 @@
elif standard.has_key(name):
fragment = standard[name]+fragment[semi+1:]
elif greeks.has_key(name):
- fragment = greeks[name]+fragment[semi+1:]
+ fragment = unicode(greeks[name],
"utf-8")+fragment[semi+1:]
else:
# add back the &
fragment = "&"+fragment
Is it possible to commit that to the main repository somehow?
How to get a developer access to the reportlab svn?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20090909/473d4b21/attachment.html>
More information about the reportlab-users
mailing list