[reportlab-users] Special characters in paragraphs

John J. Lee jjlee at reportlab.com
Thu Dec 15 08:11:48 EST 2005


On Thu, 15 Dec 2005, Dick Kniep wrote:
[...]
> In my code I write text from a database (so this is free text) to the
> paragraph. Off course an ampersand can be replaced, but I can get all kinds
> of texts from the database. So to prevent any more crashes, I will have to
> escape all characters that are "prohibited" like <, >, &. So I have three
> questions:
>
> 1. Which characters have to be escaped
> 2. How do I escape them (ie. & becomes &amp)
> 3. Where do I find this in the manuals?
[...]

1. & 2.: xml.sax.saxutils.escape

3. Chapter 5 of the user guide and

http://www.python.org/doc/2.3.4/lib/module-xml.sax.saxutils.html

http://www.w3.org/TR/REC-xml/#syntax


John


More information about the reportlab-users mailing list