title: Python - Decode text read from input file
body: <p>Sorry if this has been answered elsewhere but I couldn't find a solution to my issue.</p>
  
  <p>I am reading in a file with service references &amp; names from a satellite receiver. I am trying to normalize the service names but the issue is that the file can contain data from many different satellites and also many different languages.</p>
  
  <p>I had this code that handled a good few of the Irish names, changing RTÉ One to RTE One etc.</p>
  
  <pre><code>name = unicodedata.normalize('NFKD', unicode(name, 'utf_8')).encode('ASCII', 'ignore')
  </code></pre>
  
  <p>name is read from the input file and it is like this:</p>
  
  <pre><code>RTÃ‰ One
  </code></pre>
  
  <p>That all works fine but then I come across a service name like this:</p>
  
  <pre><code>Î‰Ï€ÎµÎ¹ÏÎ¿Ï‚ TV1
  </code></pre>
  
  <p>It can't handle the above codec, it's obviously not utf_8?</p>
  
  <p>I tried to change the above code to this:</p>
  
  <pre><code>name = unicodedata.normalize('NFKD', force_decode(name)).encode('ASCII', 'ignore')
  </code></pre>
  
  <p>And where force_decode was a function as follows:</p>
  
  <pre><code>def force_decode(string, codecs=['latin_1', 'cp857', 'cp866', 'cp1252', 'cp855', 'iso8859_5', 'iso8859_9', 'utf_8']):
  for i in codecs:
      try:
          return string.decode(i)
      except (Exception) as exception:
          print "Error decoding name!! ", exception
          pass
  
  print "cannot decode url %s" % ([string])
  </code></pre>
  
  <p>What happens now is that the above comes out as simply TV1. I'd like if I was able to decode whatever Î‰Ï€ÎµÎ¹ÏÎ¿Ï‚ was also.</p>
  
  <p>Anyone know if this is possible?</p>
  
  <p>Thanks in advance.</p>