do not call mb_convert_encoding() if encoding is unknown

This commit is contained in:
Uwe Steinmann 2026-04-02 10:16:29 +02:00
parent e3b52ad744
commit 0663f79640

View File

@ -57,7 +57,8 @@ class SeedDMS_ConversionServiceTextToText extends SeedDMS_ConversionServiceBase
$encoding = $this->detect_utf_encoding($content);
// mb_detect_encoding() is not a good as detect_utf_encoding()
// $encoding = mb_detect_encoding($content);
$content = mb_convert_encoding($content, 'utf8', $encoding);
if ($encoding)
$content = mb_convert_encoding($content, 'utf8', $encoding);
if($target) {
file_put_contents($target, $content);
return true;