Skip to content

Commit 1eddba7

Browse files
committed
FIX: convert ASCII object names to utf-8
1 parent 6350732 commit 1eddba7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/fpdm.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -1787,6 +1787,10 @@ function parsePDFEntries(&$lines){
17871787
if(($name=="")&&preg_match("/^\/T\s?\((.+)\)\s*$/",$this->_protectContentValues($CurLine),$match)) {
17881788

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

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

21172121
}
21182122

2119-
unset($__tmp);
2123+
unset($__tmp);

0 commit comments

Comments
 (0)