title: python print statement with utf-8 and nohup
body: <p>I have a some python code that prints log messages.  When run at the command line, it does fine with utf-8.  Log messages that contain special characters print out fine.  However, when run in the background under nohup, it barfs on utf-8 characters.</p>
  
  <pre><code>nohup python2.7 myProgram.py &amp;
  </code></pre>
  
  <p>The error I see is the usual "try to encode utf in ascii" error:</p>
  
  <blockquote>
    <p>UnicodeEncodeError: 'ascii' codec
    can't encode character u'\u2013' in
    position 71: ordinal not in range(128)</p>
  </blockquote>
  
  <p>I assume this is because nohup signals to python that it doesn't have a normal terminal, so it defaults to ascii.  Is there any way to either tell nohup to run with utf-8 enabled or to set this up so that utf-8 characters won't cause a crash when running under nohup in the background?</p>