title: Why python does not behave the same when printing unicode strings in console and pipes?
body: <p>After a couple tests, I managed to restrict a misfunctionning in the minimal test.py script below:</p>
  
  <pre><code># -*- coding: iso-8859-1 -*-
  print u"Vérifier l'affichage de cette chaîne"
  </code></pre>
  
  <p>Note: test.py is encoded in ISO-8859-1 (ie latin-1), ie "é" equals "\xe9" and "î" equals "\xee"</p>
  
  <pre><code>D:\test&gt;python --version
  Python 2.7.3
  D:\test&gt;python test.py
  Vérifier l'affichage de cette chaîne
  D:\test&gt;python test.py &gt; test.log
  Traceback (most recent call last):
    File "test.py", line 2, in &lt;module&gt;
      print u"VÚrifier l'affichage de cette cha¯ne"
  UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 1: ordinal not in range(128)
  </code></pre>
  
  <p>Here is the question :</p>
  
  <p>How come python does not behave the same when printing unicode strings whether its standard output goes to the console or is redirected or piped to something else?</p>