[reportlab-users] a guess about special characters

Dick Kniep dick at kniep.nl
Fri Nov 4 16:13:30 EST 2005


Hi Carlos, list

I have the same kind of problems. In the manual I have seen something about 
special characters, that says that you can replace the characters with a 
decimal replacement. However I still have a problem when I am using an 
ampersand ('&'). This sign should, according to the stdfonts.py be translated 
to \38, however, when I insert this into the string, I get an '8' back, 
instead of an ampersand.

The error I get is:

r.append(Paragraph(fld,parStyle))
  File "/usr/lib/python2.4/site-packages/reportlab/platypus/paragraph.py", 
line 378, in __init__
    self._setup(text, style, bulletText, frags, cleanBlockQuotedText)
  File "/usr/lib/python2.4/site-packages/reportlab/platypus/paragraph.py", 
line 403, in _setup
    raise "xml parser error (%s) in paragraph beginning\n'%s'"\
xml parser error (; missing in entityref) in paragraph beginning
'Den Besten&Sloof'

Note the '&'. As soon as I remove this, it works fine. Now I need a way to 
avoid this problem, because there is no way for me to predict what kind of 
content is sent to the paragraph.

Anyone any ideas?

Op maandag 3 oktober 2005 18:26, schreef Carlos Roberto Martínez:
> Hi, I from El Salvador an I speak spanish.
> I have problems when I use paragraph() function for
> write special characters like "á" or "É" (spanish
> language). Reportlab prints stranges characters.
> Can you help me? Thanks
>
> __________________________________________________
> Correo Yahoo!
> Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
> Regístrate ya - http://correo.espanol.yahoo.com/
> _______________________________________________
> reportlab-users mailing list
> reportlab-users at reportlab.com
> http://two.pairlist.net/mailman/listinfo/reportlab-users

Cheers,
Dick Kniep


More information about the reportlab-users mailing list