FPDF utf-8 encoding (HOW-TO)

Don’t use UTF-8 encoding. Standard FPDF fonts use ISO-8859-1 or Windows-1252. It is possible to perform a conversion to ISO-8859-1 with utf8_decode():
$str = utf8_decode($str);
But some characters such as Euro won’t be translated correctly. If the iconv extension is available, the right way to do it is the following:
$str = iconv('UTF-8', 'windows-1252', $str);

Leave a Comment