[reportlab-users] Unicode problem in para.py

Michael Egorov michwill at gmail.com
Wed Sep 9 06:01:50 EDT 2009


P.S. just noticed that if the text is in utf-8 instead of unicode everything
is fine

2009/9/9 Michael Egorov <michwill at gmail.com>


> 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/ed3d4c3b/attachment.html>


More information about the reportlab-users mailing list