<div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">But I don't think it's a good idea. Changing the default encoding will<br>change it for *all* scripts, *all* users, *all* objects. And AFAIK you
<br>have trouble ONLY with sys.std* - one should fix those objects, not mess<br>with a global configuration.<br></blockquote></div><br>Makes sense... Do you think that creating a new object, setting it as sys.stdout and overriding its write() method to check for a unicode string to do original_stdout.write(unicode_str.encode(my_encoding)) would do it? (the ctypes version is not really an option as it is not available on lots of installs -- although I can try to use it if it's available, but it can't be the only solution).
<br><br>Thanks,<br><br>Fabio<br>