title: while html to pdf converting with pisa hindi words are in coded way
body: <p>while converting Hindi words in HTML to pdf by using the xhtml2pdf library in Django projects I am getting some coded words on how to convert in the correct way?</p>
  <pre><code>def render_to_pdf(template_src, context_dict={}):
    template = get_template(template_src)
    html  = template.render(context_dict)
    result = BytesIO()
   
    pdf = pisa.pisaDocument(BytesIO(html.encode(&quot;UTF-8&quot;)), result, encoding='UTF-8')
    if not pdf.err:
        return HttpResponse(result.getvalue(), content_type='application/pdf')
    return None
  </code></pre>
  <p><a href="https://i.stack.imgur.com/g1jvP.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/g1jvP.jpg" alt="pdf image" /></a></p>