[reportlab-users] Unicode character Eclipse IDE vs. MS VisualStudio 2012
Tom Py
mailtank2013 at gmail.com
Fri Jan 18 05:18:22 EST 2013
Hi Robin,
in Eclipse IDE it works fine but in VS2012 I get an error for both ways:
Traceback (most recent call last):
File "C:\Program Files (x86)\IronPython
2.7.2\lib\site-packages\reportlab\platypus\tables.py", line 562, in
_calc_height
File "C:\Daten\reportlabTest\reportlabTest\reportlabTest.py", line 9, in
<module>
File "C:\Program Files (x86)\IronPython
2.7.2\lib\site-packages\reportlab\platypus\flowables.py", line 120, in
wrapOn
File "C:\Program Files (x86)\IronPython
2.7.2\lib\site-packages\reportlab\platypus\tables.py", line 1172, in wrap
File "C:\Program Files (x86)\IronPython
2.7.2\lib\site-packages\reportlab\platypus\tables.py", line 624, in _calc
UnicodeDecodeError: ('unknown', u'\xc3', 0, 1, '')Press any key to continue
. . .
Any idea?
Tom
2013/1/17 Robin Becker <robin at reportlab.com>
> On 17/01/2013 09:37, Tom Py wrote:
> ..........).
>
>
>>
>> min. example begin
>>
>> # -*- coding: latin-1 -*-
>>
>> from reportlab.pdfgen import canvas
>> from reportlab.platypus import Table
>>
>> str = [['ü']]
>> myCanvas = canvas.Canvas("test.pdf")
>> tableData = Table(str)
>> tableData.wrapOn(myCanvas, 0, 0)
>> tableData.drawOn(myCanvas, 0, 0)
>>
>> myCanvas.getpdfdata()
>>
>> print 'done'
>>
>> min. example end
>>
>>
>> I'm using IronPython 2.7.2 and ReportLab 2.5
>>
>> Does anyone have an idea?
>>
>>
>> Thx, Tom
>>
> ......
>
> CPython reportlab supports unicode or utf8 encodings so you could try
>
> str = [[u'ü']]
>
>
> or
>
> str = [[u'ü'.encode('utf8')]]
>
> you seem to be using latin-1 so that's where the error comes from
> --
> Robin Becker
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20130118/fc16cd63/attachment.html>
More information about the reportlab-users
mailing list