title: trouble in converting unicode template to pdf using xhtml2pdf
body: <p>I have unicode used in my html page, which is displaying correctly in the html page. But while converting it into html using xhtml2pdf, it generating black, solid square boxes in the unicodes. Is there some setting for unicode other than UTF-8 setting. I dont think its unicode problem.  </p>
  
  <pre><code># convert HTML to PDF
  pisaStatus = pisa.CreatePDF(
          StringIO(sourceHtml.encode('utf-8')),                 
          dest=resultFile)
  </code></pre>
  
  <h1>Complete py code:</h1>
  
  <pre><code># -*- coding: utf-8 -*-
  
  from xhtml2pdf import pisa
  from StringIO import StringIO
  
  source = """&lt;html&gt;
              &lt;style&gt;
                  @font-face {
                  font-family: Preeti;
                  src: url("preeti.ttf");
                  }
  
                  body {
                  font-family: Preeti;
                  }
              &lt;/style&gt;
              &lt;body&gt;
                  This is a test &lt;br/&gt;
                         सरल
              &lt;/body&gt;
          &lt;/html&gt;"""
  
  # Utility function
  def convertHtmlToPdf(source):
      # open output file for writing (truncated binary)
  
      pdf = StringIO()
      pisaStatus = pisa.CreatePDF(StringIO(source.encode('utf-8')), pdf)
  
      # return True on success and False on errors
      print "Success: ", pisaStatus.err
      return pdf
  
  # Main program
  if __name__=="__main__":
      print pisa.showLogging()
      pdf = convertHtmlToPdf(source)
      fd = open("test.pdf", "w+b")
      fd.write(pdf.getvalue())
      fd.close()
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/uIhnV.png" alt="generated pdf file"></p>
  
  <p>Do I even Need to include the font-face ??</p>