0
轉換爲UTF8視圖我有編碼的問題,我試着用笨到我的HTML轉換成UTF8,所以我的代碼是:使用笨
public function generateTitlePage($company)
{
$this->load->library('dompdf_gen');
$dompdf = new DOMPDF();
$search = array('%27', '%20', '%C3%A2', '%C3%AE');
$replace = array('', ' ', 'â', 'î');
$company = str_replace($search, $replace, $company);
$html = '
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
<div style="margin-top:20px;text-align: center;font-weight: bold">
LIMITATĂ'.$company.'
</div>
</body>
</html>
';
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("welcome.pdf");
}
所以,我的輸出PDF格式是LIMITAT?公司名稱,我不明白爲什麼不轉換是使用meta標籤,我也使用Codeigniter配置:$ config ['charset'] ='UTF-8';幫我pleaaaaase,日Thnx提前