Handling text lines from files with some (few) starnge chars

Paulo da Silva psdasilva.nospam at netcabonospam.pt
Sat Jun 5 23:27:33 EDT 2010


Em 06-06-2010 04:05, John Machin escreveu:
> On Jun 6, 12:14 pm, MRAB <pyt... at mrabarnett.plus.com> wrote:
>> Paulo da Silva wrote:
...

>>> OK! This fixes my current problem. I used encoding="iso-8859-15". This
>>> is how my text files are encoded.
>>> But what about a more general case where the encoding of the text file
>>> is unknown? Is there anything like "autodetect"?
>>
...

> 
> This has been automated (semi-successfully, with caveats) by the
> chardet package ... see http://chardet.feedparser.org/

This seems nice!
Thanks



More information about the Python-list mailing list