[Image-SIG] ImageFont Unicode Decode error
donn.ingle at gmail.com
Thu Dec 27 16:46:35 CET 2007
> I don't know, but may be PIL needs to have the Byte Order Mark for handling
Not 100% sure what you are saying.
That character is ( I don't know if it will travel ) "å" and I can open files
that contain it with my other python stuff like codes.open etc.
Are you suggesting a solution to me or thinking aloud :)
I'm on Kubuntu Gnu/Linux 7.10 with Python 2.5
> Trying to open a ttf file with a non-standard character in it (u'\xe5')
> causes an error, no matter what I pass to encoding:
> font = ImageFont.truetype( paf, 64, index=i , encoding=enc )
> The error:
> File "/usr/lib/python2.5/site-packages/PIL/ImageFont.py", line 205, in
> return FreeTypeFont(filename, size, index, encoding)
> File "/usr/lib/python2.5/site-packages/PIL/ImageFont.py", line 121, in
> self.font = _imagingft.getfont(file, size, index, encoding)
> UnicodeEncodeError: 'ascii' codec can't encode character u'\xe5' in
> 66: ordinal not in range(128)
> Is there something I'm doing wrong, or is this a bug?
More information about the Image-SIG