title: Read a text file with non-ASCII characters in an unknown encoding
body: <p>I want to read a file that contains also <strong>German and not only characters</strong>. I found that i can do like this</p>
  
  <pre><code>  &gt;&gt;&gt; import codecs
    &gt;&gt;&gt; file = codecs.open('file.txt','r', encoding='UTF-8')
    &gt;&gt;&gt; lines= file.readlines()
  </code></pre>
  
  <p>This is working when i try to run my job in Python IDLE but when i try to run it from somewhere else does not give correct result. Have a idea?</p>