Try this

mensanator at aol.com mensanator at aol.com
Mon Sep 17 01:30:33 EDT 2007


On Sep 16, 8:59?pm, "J. Cliff Dyer" <j... at sdf.lonestar.org> wrote:
> mensana... at aol.com wrote:
> > The very presence of an algorithm to detect encoding is a bug.
> > Files with they .txt extension should always be treated as ANSI
> > even if they contain binary data. Notepad should never be
> > allowed to try to decide what the encoding is if the the open
> > dialog has the encoding set to ANSI.
>
> Mmmmm, yeah....  I'm going to have to go ahead and, uh, disagree with
> you there.
>
> If I open a text file in WordPad, and then do a save as, I get the
> following choices, all specifying an extension of .txt
>
> Text Document
> Text Document - MS-DOS Format
> Unicode Document
>
> If Microsoft offers to create documents in three different formats with
> the same extension, it damn well better make some effort to figure out
> which one it's trying to open when it reopens those same documents.

No, it should NOT. Unless it can do it with absolute
100% guarantee that it can get it right.

Since it cannot, it should be left to the user to
specify the encoding.

>
> Cheers,
> Cliff





More information about the Python-list mailing list