[reportlab-users] BUGFIX: Re:   in paragraph

Dirk Holtwick dirk.holtwick at gmail.com
Wed Nov 26 12:41:10 EST 2008


Hi,

to fix the described error please modify the following function in
"paragraph.py":

-----------------8<---------------[cut here]
#on UTF8 branch, split and strip must be unicode-safe!
def split(text, delim=None):
if type(text) is str: text = text.decode('utf8')
if type(delim) is str: delim = delim.decode('utf8')
# This fixes &nbsp; issue and multiple linebraks on splitted page part
if delim is None and text == u'\xa0':
delim = ' '
return [uword.encode('utf8') for uword in text.split(delim)]
-----------------8<---------------[cut here]

Cheers
Dirk

Andy Robinson schrieb:

> 2008/10/4 Dirk Holtwick <dirk.holtwick at gmail.com>:

>> Hi,

>>

>> for my project pisa <http://www.htmltopdf.org> I create the paragraph

>> fragments directly. Until version 2.1 of RL I used a non breaking space

>> placeholder like u"\u00a0" and it worked fine. Since 2.2 this one seems to

>> be considered a normal whitespace and therefore removed. Any hints how I can

>> define a fragment with just nothing in it and the length of a space

>> character?

>

> This sounds like a bug. I have logged it in our tracker (issue 679,

> and hopefully the tracker will be visible by midweek); Robin's back

> from vacation now and will hopefully be able to look at it this week

> before we do 2.2.1.

>

>

> - Andy

> _______________________________________________

> reportlab-users mailing list

> reportlab-users at reportlab.com

> http://two.pairlist.net/mailman/listinfo/reportlab-users



More information about the reportlab-users mailing list