Re: [Pythonmac-SIG] How to print unicode to OS-X Terminal.app

2008-02-14 Thread Robin Dunn
Kent Johnson wrote: > > I guess the conversion actually happens in sys.stdout.write(), not in print. That's good to know, thanks for trying it out. -- Robin Dunn Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython! _

Re: [Pythonmac-SIG] How to print unicode to OS-X Terminal.app

2008-02-14 Thread Kent Johnson
Kent Johnson wrote: > Christopher Barker wrote: >> Robin Dunn wrote: >>> Just replace sys.stdout with an object with a write() method that does >>> what you want. >> I don't think that will do it, as "print" will have already converted >> the object to a string, and it does that with str(), which

Re: [Pythonmac-SIG] How to print unicode to OS-X Terminal.app

2008-02-14 Thread Kent Johnson
Christopher Barker wrote: > Robin Dunn wrote: >> Just replace sys.stdout with an object with a write() method that does >> what you want. > > I don't think that will do it, as "print" will have already converted > the object to a string, and it does that with str(), which calls > object.__str__

Re: [Pythonmac-SIG] How to print unicode to OS-X Terminal.app

2008-02-14 Thread Robin Dunn
Christopher Barker wrote: > Robin Dunn wrote: >> Just replace sys.stdout with an object with a write() method that does >> what you want. > > I don't think that will do it, as "print" will have already converted > the object to a string, and it does that with str(), which calls > object.__str__

Re: [Pythonmac-SIG] How to print unicode to OS-X Terminal.app

2008-02-14 Thread Christopher Barker
Robin Dunn wrote: > Just replace sys.stdout with an object with a write() method that does > what you want. I don't think that will do it, as "print" will have already converted the object to a string, and it does that with str(), which calls object.__str__, which used the default encoding

Re: [Pythonmac-SIG] How to print unicode to OS-X Terminal.app

2008-02-14 Thread Robin Dunn
Christopher Barker wrote: > Kent Johnson wrote: >> You can, with sys.setdefaultencoding(). See here for discussion of how: >> http://blog.ianbicking.org/illusive-setdefaultencoding.html > > > and here for arguments that this is a bad idea (mostly because it makes > > your code non-portable): >

Re: [Pythonmac-SIG] How to print unicode to OS-X Terminal.app

2008-02-14 Thread Christopher Barker
Kent Johnson wrote: > You can, with sys.setdefaultencoding(). See here for discussion of how: > http://blog.ianbicking.org/illusive-setdefaultencoding.html > and here for arguments that this is a bad idea (mostly because it makes > your code non-portable): > http://faassen.n--tree.net/blog/view