Nikola Skoric wrote:
> Is there a way of making 'utf-8' default codec for the whole program, so 
> I don't have to do .encode('utf-8') every time I print out a string?

Explicit is better than implicit (so setting up a default codec is
considered bad practice).  However, you could wrap an output destination
with an encoder and get the effect you want.

     import sys, codecs
     sys.stdout, _held = (codecs.getwriter('utf-8')(sys.stdout),
                          sys.stdout)

--Scott David Daniels
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to