title: Unicode encoding in python
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/57708/convert-xml-html-entities-into-unicode-string-in-python">Convert XML/HTML Entities into Unicode String in Python</a><br>
    <a href="https://stackoverflow.com/questions/2087370/decode-html-entities-in-python-string">Decode HTML entities in Python string?</a>  </p>
  </blockquote>
  
  
  
  <p>I am using Python 2.7 and am fairly lost in unicode type. I looked up variety of help files and tutorials on it by I cannot get it actually working in the context I need.
  <a href="http://docs.python.org/howto/unicode.html" rel="nofollow noreferrer">http://docs.python.org/howto/unicode.html</a></p>
  
  <p>I have a library with names and it was saved decoded, ex. aaron&#39;s
  I need to encode the name into a user friendly manner
  Seems like basic answer to encoding</p>
  
  <pre><code>a ='aaron&amp;#39;s,'
  unicode(a)
  a.encode('ascii', 'replace')
  </code></pre>
  
  <p>returns:</p>
  
  <pre><code>'aaron&amp;#39;s,'
  </code></pre>
  
  <p>Which is not what I am looking for.</p>