how to set mpdf HTML contains invalid UTF-8 character(s)

pdf, php

Solution

Try this

$html = mb_convert_encoding($html, 'UTF-8', 'UTF-8');

before calling: "$mpdf->WriteHTML($html);"

It's seems senseless, but it works for me.

Problem

how to set mpdf HTML contains invalid UTF-8 character(s) when you create pdf on your appliactions

Original source