Skip to content

Commit

Permalink
Merge pull request #21 from DoobleD/develop
Browse files Browse the repository at this point in the history
Fix error mb_convert_encoding(): Argument #3 ($from_encoding) contains invalid encoding "windows-1256"
  • Loading branch information
matidau committed Sep 2, 2023
2 parents 339fe67 + 962a583 commit d11bc98
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib/utils/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -1278,7 +1278,11 @@ private static function convertRawHeader2Utf8($nonencstr, $utf8str) {
$str .= $val->text;
}
else {
$str .= @mb_convert_encoding($val->text, "utf-8", $val->charset);
try {
$str .= @mb_convert_encoding($val->text, "utf-8", $val->charset);
} catch (ValueError $exception) {
$str .= @iconv($val->charset, "utf-8", $val->text);
}
}
}
if (!$isiso2022jp) {
Expand Down

0 comments on commit d11bc98

Please sign in to comment.