Need help from someone that have PIL installed

Thomas Jollans thomas at jollans.com
Fri Aug 6 12:55:46 EDT 2010


On 08/06/2010 04:37 PM, 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

Is the file, which you claim is UTF-8 encoded, actually UTF-8 encoded?
If you're not sure, explicitly tell your text editor to save the file as
UTF-8, and then try again.

> 
> 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 
> 
> 
> 




More information about the Python-list mailing list