title: How to force python functions to work with UTF-8
body: <p>I have problem with python function <code>os.path.isdir</code></p>
  
  <p>While I'm trying to use it I get: <code>UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 36: ordinal not in range(128)</code></p>
  
  <p>I've already placed coding "stamp" in the header of my file <code>#!/usr/bin/env python # coding: utf-8  </code></p>
  
  <p>I also use rather proper string decoding that enables getting utf-8 signs (I load them by QT QLineEdit - but this does not matter). </p>
  
  <pre><code>tmp_filepath = u''
  tmp_filepath = tmp_filepath.decode('utf-8')
  tmp_filepath += QtGui.QFileDialog.getExistingDirectory(self,"Choose directory",self.directorypath,QtGui.QFileDialog.ShowDirsOnly)
  </code></pre>
  
  <p>Problem occurs while I'm trying to use: <code>os.path.isdir(tmp_filepath)</code></p>
  
  <p>I've read that this may be caused by bad python version (non utf-8) but I couldn't find other info about this. I use python 2.6.5 on Linux Ubuntu 10.04.</p>