"Gabriel Genellina" <gagsl-...@yahoo.com.ar> writes: > Python knows the terminal encoding (or at least can make a good > guess), but a file may use *any* encoding you want, completely > unrelated to your terminal settings.
It may, yes, and the programmer is free to specify any encoding. > So when stdout is redirected, Python refuses to guess its encoding; But Python doesn't have to guess; the terminal encoding is as specified in either case, no? > see the PYTHONIOENCODING environment variable. For the standard streams, the specified terminal encoding available to every program makes the most sense — certainly more sense than a Python-specific variable, or the “default to ASCII” of the current behaviour. -- \ “Holy uncanny photographic mental processes, Batman!” —Robin | `\ | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list