title: Python 2.7, How to convert (ord>128) string into unicode
body: <p>I am trying to convert a standard string containing >128 chars into Unicode.
  For example, </p>
  
  <pre><code>a='en métro'
  b=u'en métro'
  c = whatToDoWith(a) 
  </code></pre>
  
  <p>so that I can get c exactly equals to b, in both types and values.</p>
  
  <p>In my real program I got the following error when <code>txt = 'en métro'
  </code></p>
  
  <pre><code> utxt = txt.decode('utf8')
   File "C:\Python27\lib\encodings\utf_8.py", line 16, in decode
   return codecs.utf_8_decode(input, errors, True)
   UnicodeDecodeError: 'utf8' codec can't decode byte 0xe9 in position 3: invalid continuation byte
  </code></pre>
  
  <p>To investigate, I also have the following test code:</p>
  
  <pre><code># -*- coding: utf-8 -*-
  
  c='en métro'
  print type(c)
  print c
  d=c.decode('utf8')
  print type(d)
  print d
  a='中文'
  print type(a)
  print a
  b=a.decode('utf8')
  print type(b)
  print b
  </code></pre>
  
  <p>and this time result is expected:</p>
  
  <pre><code>&lt;type 'str'&gt;
  en mÃ©tro
  &lt;type 'unicode'&gt;
  en métro
  &lt;type 'str'&gt;
  ä¸­æ–‡
  &lt;type 'unicode'&gt;
  中文
  </code></pre>
  
  <p>I cannot tell what's the different with my real program.  I also have the 
  <code># -*- coding: utf-8 -*-</code> line in it.  </p>
  
  <p>Can someone point out possible problems?</p>