title: TypeError: decoding Unicode is not supported python
body: <p>I am using lxml.html to parse an html file and get the text from the page. Bur now I have a string which has a character <code>'</code> for example <code>Florian's</code> due to which, while printing the output I get traceback</p>
  
  <pre><code>parent_link_id_text =  parent_link_id.xpath('./td[@width="400"]/text()')
  print (SGS_Mid[0]+";"+"External"+";"+str(link_id_num[0])+";"+parent_link_id_text[0]+";"+parent_link_link[0], file = log_file_1)
  </code></pre>
  
  <blockquote>
    <p>UnicodeEncodeError: 'ascii' codec can't encode characters in position 56-58: ordinal not in range(128)</p>
  </blockquote>
  
  <p>Then I tried this </p>
  
  <pre><code>print (SGS_Mid[0]+";"+"PublicFreeUrl"+";"+str(link_id_num[0])+";"+unicode(parent_link_id_text[0],"utf-8")+";"+parent_link_link[0], file = log_file_1)
  </code></pre>
  
  <p>and I get a traceback:</p>
  
  <blockquote>
    <p>TypeError: decoding Unicode is not supported</p>
  </blockquote>
  
  <p>How can I solve this by printing the string with the unicode character?</p>