Smarter way to do this? Unicode + stdin, stdout

"Martin v. Löwis" martin at v.loewis.de
Sun Dec 17 04:18:24 EST 2006


BenjaMinster schrieb:
> I want to read and write unicode on stdin and stdout.  I can't seem to
> find any way to force sys.stdin.encoding and sys.stdout.encoding to be
> utf-8, so I've got the following workaround:

What operating system are you using? Why do you want to do this?
Python attempts to determine the encoding of your terminal (if
sys.stdout is a terminal), and set sys.stdout.encoding accordingly.

Regards,
Martin



More information about the Python-list mailing list