From 6fba87b224820918b3d522be1103b1a56fb5bf25 Mon Sep 17 00:00:00 2001 From: Stasky745 Date: Thu, 23 Feb 2023 12:26:00 +0100 Subject: [PATCH] fix to iconv() illegal character error (issue #549) --- src/Smalot/PdfParser/Font.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Smalot/PdfParser/Font.php b/src/Smalot/PdfParser/Font.php index 72457e1a..111a23ba 100644 --- a/src/Smalot/PdfParser/Font.php +++ b/src/Smalot/PdfParser/Font.php @@ -603,7 +603,7 @@ private function decodeContentByEncodingElement(string $text, Element $encoding) // so we use iconv() here $iconvEncodingName = $this->getIconvEncodingNameOrNullByPdfEncodingName($pdfEncodingName); - return $iconvEncodingName ? iconv($iconvEncodingName, 'UTF-8', $text) : null; + return $iconvEncodingName ? iconv($iconvEncodingName, 'UTF-8//TRANSLIT//IGNORE', $text) : null; } /**