我在 codeigniter 中使用 DOMPDF 库从 mysql 获取数据。但是当我尝试为印地语字体生成 PDF 时,我的表中有一些字段是印地语(印地语的 unicode 形式),它没有显示正确的内容。请帮助我摆脱困境。
这是我的控制器
public function genrate_pdf($benef_detial,$count){
$data['repo_result'] = $benef_detial;
$data['total_benif'] = $count;
$data['page_title'] = "Benificiary Details";
$this->load->library('pdf');
$html = utf8_decode($this->pdf->load_view('public_reports/pdf_view',$data));
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->set_paper("a4", "landscape" );
$this->template->set_template('default');
$this->pdf->render();
$this->pdf->stream("public_reports/pdf_view.pdf"); }
我添加了元标记
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
在 pdf_view 和模板中
如果我用英语制作表格字段数据,那么它可以正常工作,但在印地语 unicode 的情况下,它会显示类似的结果
सिà¤,गरà¥OEली</p>
请帮我。
谢谢