我在用阿拉伯语单词渲染pdf模板时遇到问题,我使表格包含存储的类(商品)行,这是生成pdf的代码
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("iso-8859-6")), result)
if not pdf.err:
return HttpResponse(result.getvalue(), content_type='application/pdf')
return None
在编码中,我输入了iso-8859-6,我搜索了阿拉伯语编码,然后尝试使用它,它无法正常工作,没有任何帮助,谢谢