Force UTF-8 output (mostly when not talking to a tty)
<p>I am doing this:</p>

<pre><code>import sys, codecs
sys.stdout = codecs.getwriter('utf8')(sys.stdout)
sys.stderr = codecs.getwriter('utf8')(sys.stderr)
</code></pre>

<p>But I know there is something missing. I had a huge collection of code before an HD crash, and my snippet in there had something in it which prevented:</p>

<pre><code>reload(sys)
</code></pre>

<p>From undoing the codec changes. Does anyone know what that might have been?</p>
