Skip to content

Commit

Permalink
FIX: convert ASCII object names to utf-8
Browse files Browse the repository at this point in the history
  • Loading branch information
codeshell committed Jun 11, 2019
1 parent 6350732 commit 1eddba7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/fpdm.php
Original file line number Diff line number Diff line change
Expand Up @@ -1787,6 +1787,10 @@ function parsePDFEntries(&$lines){
if(($name=="")&&preg_match("/^\/T\s?\((.+)\)\s*$/",$this->_protectContentValues($CurLine),$match)) {

$name=$this->_unprotectContentValues($match[1]);
//FIX: convert ASCII object names to utf-8
// don't use utf8_encode($name) yet, it's core function since php 7.2
$name = mb_convert_encoding($name, 'UTF-8', 'ASCII');
//ENDFIX
if($verbose_parsing) echo ("Object's name is '<i>$name</i>'");

$object["infos"]["name"]=$name; //Keep a track
Expand Down Expand Up @@ -2116,4 +2120,4 @@ function Error($msg) {

}

unset($__tmp);
unset($__tmp);

0 comments on commit 1eddba7

Please sign in to comment.