I use dompdf to render my html pages to pdf. I prepared templates in php and used the codes below. It works fine on localhost, but fails (shows question marks instead of unicode chars) when I upload it on the server. And FontAwesome also fails to show icons.
generator.php
<?php
session_start();
ob_start();
//dompdf
require_once('../../dompdf/autoload.inc.php');
use Dompdf\Dompdf;
require_once('../pdf-template/template.php');
$template=ob_get_clean();
$dompdf=new Dompdf();
$dompdf->loadHtml($template);
//paper
$dompdf->setPaper('A4','portrait');
// render
$dompdf->render();
$pdf_content = $dompdf->output();
file_put_contents('test.pdf',$pdf_content);
echo "successful";
?>
template.php
<i class="fa fa-paw"></i>
<h2 style="font-family: DejaVu Sans; font-size: 22px">ığĞüÜşŞİöÖçÇ</h2>