title: Python 3 UTF-8 encoding doesnt really work
body: <p>I have read a lot now on the topic of UTF-8 encoding in Python 3 but it still doesn't work, and I can't find my mistake.</p>
  
  <p>My code looks like this</p>
  
  <pre><code>def main():
  
      with open("test.txt", "rU", encoding='utf-8') as test_file:
          text = test_file.read()
      print(str(len(text)))
  
  
  if __name__ == "__main__":
  
      main()
  </code></pre>
  
  <p>My <code>test.txt</code> file looks like this</p>
  
  <pre><code>ö
  </code></pre>
  
  <p>And I get the following error:</p>
  
  <pre><code>UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf6 in position 0: invalid start byte
  </code></pre>