How to "hook" print statement.

Gillou nospam at bigfoot.com
Mon Mar 18 16:23:22 EST 2002


My problem (Windows)...

I get text in cp1252 (sampled from a file) I want to print to the console.
For this I need to recode this text in cp850 before printing. But if the
stdout is redirected to a file, I need to keep it in cp1252 encoding.

They got strange ideas at MS to hve 2 different encodings for Windows and
DOS console mode.

Any clue to have this done as transparently as possible ?

Thanks in advance.

--Gilles





More information about the Python-list mailing list