Quote:
Originally Posted by kovidgoyal
IIRC PIL requires UTF-8 encoded text. There's probably some double encoding going on somewhere.
|
Actually I tried it out with my patch. And it appears that PIL happily accepted the Unicode text and generated a proper image. Moreover, doing the utf-8 encoding as the current code does gives the wrong result. I think it is Qt that requires utf-8, not PIL.
The PIL documentation contains an example where Unicode text is given to draw:
Code:
font = ImageFont.truetype("symbol.ttf", 16, encoding="symb")
draw.text((0, 0), unichr(0xF000 + 0xAA))
I think it should have an additional parameter font=font
Quote:
Originally Posted by kovidgoyal
There's probably some double encoding going on somewhere. Try this instead:
text = title.encode('utf-8') if isinstance(title, unicode) else title
And also use
u'La Raz\xc3\xb3n' instead of u'La Razón'
|
That seems very wrong to me (forcing a double encoding yourself).