title: Python UTF-8 encoding wrong representation
body: <p>I'm using python 2.7.X. I load some XML and the XML is utf-8 encoded. So I do the following:</p>
  
  <pre><code>def get_xml(self):
      r = requests.get("https://dataserver.com")
      xml = r.text
      return xml.encode("utf-8")
  
  def parse_xml(xml):
      tree = ET.fromstring(xml)
      for child in tree:
          print "    Raw type = " + str(type(child.attrib["name"]))
          print "Encoded type = " + str(type(child.attrib["name"].encode("utf-8")))
          print child.attrib["name"].encode("utf-8")
          print str(child.attrib["name"])
          print "------------"
  </code></pre>
  
  <p>This results in the following error:</p>
  
  <pre><code>    Raw type = &lt;type 'unicode'&gt;
  Encoded type = &lt;type 'str'&gt;
  MalmÃ¶ FF - Paris SG
  Traceback (most recent call last):
  ...
  UnicodeEncodeError: 'ascii' codec can't encode characters in position 4-5: ordinal not in range(128)
  </code></pre>
  
  <p>So, the <code>UnicodeEncodeError</code>is clear to me. However, after having encoded the <code>unicode</code>string as a <code>utf-8</code>string I would expect it to be correctly represented. That is, the <code>MalmÃ¶ FF</code> should actually be <code>Malmö FF</code>. </p>
  
  <p>What am I doing wrong here?</p>