Skip to content
Snippets Groups Projects
Commit cea82631 authored by Peter Rotich's avatar Peter Rotich
Browse files

Merge pull request #765 from greezybacon/issue/htmlchars-in-pdf


Better converting from ticket thread to PDF

Reviewed-By: default avatarPeter Rotich <peter@osticket.com>
parents fed23043 baf36407
No related branches found
No related tags found
No related merge requests found
......@@ -91,11 +91,21 @@ class Ticket2PDF extends FPDF
}
function _utf8($text) {
// Assume text is in utf-8 charset
$flags = ENT_COMPAT;
if (phpversion() >= '5.4.0')
$flags |= ENT_HTML401;
if(function_exists('iconv'))
// Assume text in the database is HTML
$text = html_entity_decode($text, $flags, 'UTF-8');
if (function_exists('iconv'))
return iconv('UTF-8', 'windows-1252', $text);
elseif (function_exists('utf8_decode'))
return utf8_decode($text);
return utf8_encode($text);
// XXX: FPDF does not support UTF-8 encoding
return $text;
}
function _print() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment