title: how to convert u'\uf04a' to unicode in python
body: <p>I am trying to decode u'\uf04a' in python thus I can print it without error warnings. In other words, I need to convert stupid microsoft Windows 1252 characters to actual unicode</p>
  
  <p>The source of html containing the unusual errors comes from here <a href="http://members.lovingfromadistance.com/showthread.php?12338-HAVING-SECOND-THOUGHTS" rel="nofollow noreferrer">http://members.lovingfromadistance.com/showthread.php?12338-HAVING-SECOND-THOUGHTS</a></p>
  
  <p>Read about u'\uf04a' and u'\uf04c' by clicking here <a href="http://www.fileformat.info/info/unicode/char/f04a/index.htm" rel="nofollow noreferrer">http://www.fileformat.info/info/unicode/char/f04a/index.htm</a></p>
  
  <p>one example looks like this:</p>
  
  <pre><code>"Oh god please some advice ":
  </code></pre>
  
  <p>Out[408]: u'Oh god please some advice \uf04c'</p>
  
  <p>Given a thread like this as one example for test:</p>
  
  <pre><code>thread = u'who are you \uf04a Why you are so harsh to her \uf04c'
  thread.decode('utf8')
  
  print u'\uf04a'
  print u'\uf04a'.decode('utf8') # error!!!
  </code></pre>
  
  <blockquote>
    <p>'charmap' codec can't encode character u'\uf04a' in position 1526: character maps to undefined</p>
  </blockquote>
  
  <p>With the help of two Python scripts, I successfully convert the u'\x92', but I am still stuck with u'\uf04a'. Any suggestions?</p>
  
  <p><strong>References</strong></p>
  
  <p><a href="https://github.com/AnthonyBRoberts/NNS/blob/master/tools/killgremlins.py" rel="nofollow noreferrer">https://github.com/AnthonyBRoberts/NNS/blob/master/tools/killgremlins.py</a></p>
  
  <p><a href="https://stackoverflow.com/questions/12357261/handling-non-standard-american-english-characters-and-symbols-in-a-csv-using-py">Handling non-standard American English Characters and Symbols in a CSV, using Python</a></p>
  
  <p><strong>Solution:</strong></p>
  
  <p>According to the comments below: I replace these character set with the question mark('?')</p>
  
  <pre><code>thread = u'who are you \uf04a Why you are so harsh to her \uf04c'
  thread = thread.replace(u'\uf04a', '?')
  thread = thread.replace(u'\uf04c', '?')
  </code></pre>
  
  <p>Hope this helpful to the other beginners. </p>