UnicodeError with OCR Text

Thomas Guettler guettli at thomas-guettler.de
Fri May 23 14:43:38 EDT 2003


On Fri, May 23, 2003 at 10:09:06AM -0700, Paradox wrote:

[cut]
> fullText = fullText + fileContent.encode('ascii') + '\n'
> UnicodeError: ASCII encoding error: ordinal not in range(128)
> 
> I think I isolated it to the degree character "º" HEX is BA, ASCII is
> 186.

not in range(128) <---> 186

ascii only defines seven bits. This means 0 up to 127. Everything
above 127 is not ascii. Maybe you can use encode("latin-1"). 

man iso-8859-1:
 272   186   BA     º     MASCULINE ORDINAL INDICATOR

 thomas


-- 
Thomas Guettler <guettli at thomas-guettler.de>
http://www.thomas-guettler.de






More information about the Python-list mailing list