[IronPython] Answer from ReportLab about unicode chars
Marco Parenzan
marco.parenzan at libero.it
Thu Aug 20 12:00:06 CEST 2009
I have posted my question about unicode chars also to reportlab.
I have some answers. Any comment?
Marco [dot] Parenzan [at] libero [dot] it
------------------------------
Message: 4
Date: Thu, 20 Aug 2009 10:10:49 +0100
From: Robin Becker <robin at reportlab.com>
Subject: Re: [reportlab-users] IronPython and ReportLab
To: Support list for users of Reportlab software
<reportlab-users at reportlab.com>
Message-ID: <4A8D1319.8020205 at chamonix.reportlab.co.uk>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Marco,
in CPython reportlab we expect all strings to be either bytes in utf8
encoding
or unicode. I suspect that the default string encoding in ironpython is
something other than that so a lot of reportlab string handling may be
broken.
Does ironpython support unicode directly ie u'Hello World'?
I would not expect reportlab to work out of the box with ironpython. PDF
doesn't
use unicode (normally) and most of the output is in Adobe specific
encodings.
I don't think the real problem lies in our use of strange bytes (although
that
may not help). If the string in question is the special sequence we use at
the
beginning of the document then the issue is deeper since that string doesn't
normally require any special manipulation (ie we expect it to appear
literally
in the output as a sequence of bytes). If we are unable to write bytes
directly
to a file then many other problems will also need to be found and fixed.
This problem also arises in Python 3.x so may eventually be solved for you.
As to why reportlab takes so long to execute I cannot say.
--
Robin Becker
------------------------------
Message: 5
Date: Thu, 20 Aug 2009 21:20:25 +1200
From: Tony Meyer <tony at spamexperts.com>
Subject: Re: [reportlab-users] IronPython and ReportLab
To: Support list for users of Reportlab software
<reportlab-users at reportlab.com>
Message-ID:
<da3a43060908200220g9ccdb64w4d19a262fccbef9d at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
(For context, I've only ever used ReportLab with CPython. I do use
IronPython for other things, though).
> Does ironpython support unicode directly ie u'Hello World'?
Yes. IronPython is like Python 3.x in that there are only unicode
strings (`str is unicode` evaluates to True).
> As to why reportlab takes so long to execute I cannot say.
IronPython is faster than CPython with some things, but CPython is
much, much faster at starting up than IronPython. I suspect that
Marco is just seeing the regular slow startup of IronPython.
Cheers,
Tony
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20090820/33fdea8f/attachment.html>
More information about the Ironpython-users
mailing list