@dobsun and anyone that needs a perfect solution, please take the following steps the issue will be fixed in the next phprad update.
add this code
<meta charset="UTF-8">
in the head tag before <title><?php echo $this->report_title; ?></title> and replace this
body,
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 0px;
padding: 0px;
font-family: Arial, Helvetica, sans-serif;
}
with this
body,
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 0px;
padding: 0px;
font-family: "DejaVu Sans";
}
in app/views/layouts/report_layout.php.
Now replace the following
/**
* DomDocument Manipulation
* Set the inner html of a page element
* @return string
*/
private function setInnerHTML($element, $html)
{
$html = htmlentities($html);
$fragment = $element->ownerDocument->createDocumentFragment();
$fragment->appendXML($html);
$clone = $element->cloneNode(); // Get element copy without children
$clone->appendChild($fragment);
$element->parentNode->replaceChild($clone, $element);
}
with this
/**
* DomDocument Manipulation
* Set the inner html of a page element
* @return string
*/
private function setInnerHTML($element, $html)
{
$html = html_entity_decode($html);
$html = fixWrongUTF8Encoding($html);
$fragment = $element->ownerDocument->createDocumentFragment();
$fragment->appendXML($html);
$clone = $element->cloneNode(); // Get element copy without children
$clone->appendChild($fragment);
$element->parentNode->replaceChild($clone, $element);
}
in system/BaseView.php.
and finally, add this function
function fixWrongUTF8Encoding($String) {
$fix_accent_list = array(
// 3 char errors first
'‚' => '‚', '„' => '„', '…' => '…', '‡' => '‡',
'‰' => '‰', '‹' => '‹', '‘' => '‘', '’' => '’',
'“' => '“', '•' => '•', '–' => '–', '—' => '—',
'â„¢' => '™', '›' => '›', '€' => '€',
// 2 char errors
'Â' => 'Â', 'Æ’' => 'ƒ', 'Ã' => 'Ã', 'Ä' => 'Ä',
'Ã…' => 'Å', 'â€' => '†', 'Æ' => 'Æ', 'Ç' => 'Ç',
'ˆ' => 'ˆ', 'È' => 'È', 'É' => 'É', 'Ê' => 'Ê',
'Ë' => 'Ë', 'Å’' => 'Œ', 'ÃŒ' => 'Ì', 'Ž' => 'Ž',
'ÃŽ' => 'Î', 'Ñ' => 'Ñ', 'Ã’' => 'Ò', 'Ó' => 'Ó',
'â€' => '”', 'Ô' => 'Ô', 'Õ' => 'Õ', 'Ö' => 'Ö',
'×' => '×', 'Ëœ' => '˜', 'Ø' => 'Ø', 'Ù' => 'Ù',
'Å¡' => 'š', 'Ú' => 'Ú', 'Û' => 'Û', 'Å“' => 'œ',
'Ãœ' => 'Ü', 'ž' => 'ž', 'Þ' => 'Þ', 'Ÿ' => 'Ÿ',
'ß' => 'ß', '¡' => '¡', 'á' => 'á', '¢' => '¢',
'â' => 'â', '£' => '£', 'ã' => 'ã', '¤' => '¤',
'ä' => 'ä', 'Â¥' => '¥', 'Ã¥' => 'å', '¦' => '¦',
'æ' => 'æ', '§' => '§', 'ç' => 'ç', '¨' => '¨',
'è' => 'è', '©' => '©', 'é' => 'é', 'ª' => 'ª',
'ê' => 'ê', '«' => '«', 'ë' => 'ë', '¬' => '¬',
'ì' => 'ì', '®' => '®', 'î' => 'î', '¯' => '¯',
'ï' => 'ï', '°' => '°', 'ð' => 'ð', '±' => '±',
'ñ' => 'ñ', '²' => '²', 'ò' => 'ò', '³' => '³',
'ó' => 'ó', '´' => '´', 'ô' => 'ô', 'µ' => 'µ',
'õ' => 'õ', '¶' => '¶', 'ö' => 'ö', '·' => '·',
'÷' => '÷', '¸' => '¸', 'ø' => 'ø', '¹' => '¹',
'ù' => 'ù', 'º' => 'º', 'ú' => 'ú', '»' => '»',
'û' => 'û', '¼' => '¼', 'ü' => 'ü', '½' => '½',
'ý' => 'ý', '¾' => '¾', 'þ' => 'þ', '¿' => '¿',
'ÿ' => 'ÿ', 'À' => 'À',
// 1 char errors last
'Ã' => 'Á', 'Å' => 'Š', 'Ã' => 'Í', 'Ã' => 'Ï',
'Ã' => 'Ð', 'Ã' => 'Ý', 'Ã' => 'à', 'Ã' => 'í'
);
//Cyrillic/Russian characters
$Cyrillic = [
'а','б','в','г','д','е','ё','ж','з','и','й','к','л','м','н','о','п',
'р','с','т','у','ф','х','ц','ч','ш','щ','ъ','ы','ь','э','ю','я',
'А','Б','В','Г','Д','Е','Ё','Ж','З','И','Й','К','Л','М','Н','О','П',
'Р','С','Т','У','Ф','Х','Ц','Ч','Ш','Щ','Ъ','Ы','Ь','Э','Ю','Я'
];
//Cyrillic/Russian characters in UTF-8
$UTF8Equivalent = ['а','б','в','г','д','е','Ñ‘','ж','з','и','й','к','л','м','н','о','п','Ñ€','Ñ','Ñ‚','у','Ñ„','Ñ…','ц','ч','ш','щ','ÑŠ','Ñ‹','ÑŒ','Ñ','ÑŽ','Ñ', 'Ð','Б','Ð’','Г','Д','Е','Ð','Ж','З','И','Й','К','Л','Ðœ','Ð','О','П', 'Ð ','С','Т','У','Ф','Ð¥','Ц','Ч','Ш','Щ','Ъ','Ы','Ь','Ð','Ю','Я'
];
//we get our accent characters and its utf-8 equivalent characters
$error_chars = array_keys($fix_accent_list);
$real_chars = array_values($fix_accent_list);
//we relpace the weird utf-8 accent characters with its appropriate characters
$String = str_replace($UTF8Equivalent, $Cyrillic, $String);
//we replace the weird utf-8 cyrillic characters with its appropriate characters and return it.
return str_replace($error_chars, $real_chars, $String);
}
to helpers/functions.php.
Now preview and enjoy .