[reportlab-users] Pb with Legend and unicode

philippe makowski philippemakowskicooker at gmail.com
Mon Feb 26 11:10:11 EST 2007


Hello,

I have some problem to write chart legend

When I use :
# -*- coding: iso-8859-1 -*-

legend.colorNamePairs=[(color01,'Etablissements'),
(color02,'Professions liberales'),
(color03,'Artisans'),
(color04,unicode('Créations','iso-8859-1'))
]
I get :

File legends.py, line 27, in _getStr
return str(s)
UnicodeEncodeError : 'ascii codec can't encode character u'\xe9' in position 2 :
ordinal not in range(128)

And if I do :
# -*- coding: iso-8859-1 -*-

legend.colorNamePairs=[(color01,'Etablissements'),
(color02,'Professions liberales'),
(color03,'Artisans'),
(color04,'Créations')
]

I get :

File utf_8.py, line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError : 'utf8' codec can't decode bytes in position 2-4 : invalid data

Any Clue ?
(I'm a beginner in Python)



More information about the reportlab-users mailing list