Need help from someone that have PIL installed

Peter Otten __peter__ at web.de
Fri Aug 6 16:51:16 CEST 2010


alejandro wrote:

>> # the last tuple is the background color
>> img = Image.new("RGBA",(300, 50), (0, 0, 0, 0))
> Thank you for this....
> 
>> # I think that the PIL can cope with unicode, so add a u-prefix here:
>> text = u"proba test �����"
>> draw.text((20,8), text ,font=arial, fill="red")
> 
> Nope i gives:
> SyntaxError: (unicode error) 'utf8' codec can't decode byte 0x9e in
> position 0: unexpected code byte
> 
> and without the encoding :
> SyntaxError: Non-ASCII character '\x9e' in file C:\Documents and
> Settings\Perc\My
> Documents\NetBeansProjects\venus_header\src\venus_header.py on line 16,
> but no encoding declared; see http://www.python.org/peps/pep-0263.html for
> details

Make sure that

# encoding:utf-8

is the first line of your script, details and fineprint here:

http://www.python.org/dev/peps/pep-0263/

Peter



More information about the Python-list mailing list