title: Decoding HTML Entities With Python
body: <p>The following Python code uses BeautifulStoneSoup to fetch the LibraryThing API information for Tolkien's "The Children of Húrin".</p>
  
  <pre><code>import urllib2
  
  from BeautifulSoup import BeautifulStoneSoup
  
  URL = ("http://www.librarything.com/services/rest/1.0/"
              "?method=librarything.ck.getwork&amp;id=1907912"
              "&amp;apikey=2a2e596b887f554db2bbbf3b07ff812a")
  
  soup = BeautifulStoneSoup(urllib2.urlopen(URL),
                            convertEntities=BeautifulStoneSoup.ALL_ENTITIES)
  title_field = soup.find('field', attrs={'name': 'canonicaltitle'})
  print title_field.find('fact').string
  </code></pre>
  
  <p>Unfortunately, instead of 'Húrin', it prints out 'HÃºrin'.  This is obviously an encoding issue, but I can't work out what I need to do to get the expected output.  Help would be greatly appreciated.</p>