title: python - How to properly encode string in utf8 which is ISO8859-1 from xml
body: <p>I'm using the following code in python 2.7 to retrieve an xmlFile containing some german umlauts like ä,ü,ö,ß: </p>
  
  <pre><code>.....
  def getXML(self,url):
      xmlFile=urllib2.urlopen(self.url)
      xmlResponse=xmlFile.read()
      xmlResponse=xmlResponse
      xmlFile.close()
      return xmlResponse
      pass
  
  def makeDict(self, xmlFile):
      data = xmltodict.parse(xmlFile)
      return data
  
  def saveJSON(self, dictionary):
      currentDayData=dictionary['speiseplan']['tag'][1]
      file=open('data.json','w')
      # Write the currentDay as JSON 
      file.write(json.dumps(currentDayData))
      file.close()
      return True
      pass
  
   # Execute
   url="path/to/xml/"
   App=GetMensaJSON(url)
   xml=GetMensaJSON.getXML(App,url)
  
   dictionary=GetMensaJSON.makeDict(App,xml)
   GetMensaJSON.saveJSON(App,dictionary)
  </code></pre>
  
  <p>The problem is that the xml File claims in its <code>&lt;xml&gt;</code> tag that it is utf-8. It however isn't. By trying I found out that it is iso8859_1 
  So I wanted to reconvert from utf-8 to iso8859 and back to utf-8 to resolve the conflicts. </p>
  
  <p>Is there an elegant way to resolve missing umlauts? In my code for example I have instead of ß<code>\u00c3\u009f</code> an instead of ü<code>\u00c3\u00bc</code></p>
  
  <p>I found this similar question but I can't get it to work <a href="https://stackoverflow.com/questions/31390213/how-to-parse-an-xml-file-with-encoding-declaration-in-python">How to parse an XML file with encoding declaration in Python?</a></p>
  
  <p>Also I should add that I can't influence the way I get the xml. </p>
  
  <p>The XML File Link can be found in the code. </p>
  
  <p>The output from ´repr(xmlResponse)´ is </p>
  
  <pre><code> "&lt;?xml version='1.0' encoding='utf-8'?&gt;\n&lt;speiseplan&gt;\n&lt;tag timestamp='1453676400'&gt;\n&lt;item language='de'&gt;\n&lt;category&gt;Stammessen&lt;/category&gt;\n&lt;title&gt;Gem\xc3\x83\xc2\xbcsebr\xc3\x83\xc2\xbche mit Backerbsen (25,28,31,33,34), paniertes H\xc3\x83\xc2\xa4hnchenbrustschnitzel (25) mit Paprikasauce (33,34), Pommes frites und Gem\xc3\x83\xc2\xbcse
  </code></pre>