Skip to content

Commit

Permalink
Fix utf8_encode deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
roberto-butti committed Dec 20, 2023
1 parent 2b0d328 commit 4bf45bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
]);
$rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);
$rectorConfig->sets([
LevelSetList::UP_TO_PHP_81
LevelSetList::UP_TO_PHP_82
]);
};
2 changes: 1 addition & 1 deletion src/PHPePub/Helpers/StringHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static function fixEncoding($in_str)
if (mb_detect_encoding($in_str) == "UTF-8" && mb_check_encoding($in_str, "UTF-8")) {
return $in_str;
} else {
return utf8_encode($in_str);
return mb_convert_encoding($in_str, 'UTF-8', 'ISO-8859-1');
}
}

Expand Down

0 comments on commit 4bf45bb

Please sign in to comment.