> Feel free to add code that implements this. I suppose it would be a
> good idea to have a separate function io.guess_console_encoding(...)
> which takes some argument (perhaps a raw file?) and returns an
> encoding name, never None. This could then be implemented by switching
> on the platform into platform-specific functions and a default.

I've added os.device_encoding, which returns the terminal's encoding
if possible. If the device is not a terminal, it falls back to
locale.getpreferredencoding().

Regards,
Martin

_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to