On Tue, Sep 30, 2008 at 11:42 AM, <glyph at divmod.com> wrote:
> There are other ways to glean this knowledge; for example, looking at the
> 'iocharset' or 'nls' mount options supplied to mount various filesystems. I
> thought maybe Python (or some C library call) might be invoking some logic
> that did something with data like that; if not, great, one day when I have
> some free time (meaning: never) I can implement that logic myself without
> duplicating a bunch of work.
I know we could do a better job, but absent anyone who knows what
they're doing we've chosen a fairly conservative approach. I certainly
hope that someone will contribute some mean encoding-guessing code to
the stdlib that users can use. I'm not sure if I'll ever endorse doing
this automatically in io.open(), though I'd be fine with a convention
like passing encoding="guess".
--
--Guido van Rossum (home page: http://www.python.org/~guido/)