> > But I don't think it's a good idea. Changing the default encoding will > change it for *all* scripts, *all* users, *all* objects. And AFAIK you > have trouble ONLY with sys.std* - one should fix those objects, not mess > with a global configuration. >
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). Thanks, Fabio
-- http://mail.python.org/mailman/listinfo/python-list