diff --git a/lib/private/Log/LogDetails.php b/lib/private/Log/LogDetails.php index c82904d7cea40..2e37ec1bb2f1f 100644 --- a/lib/private/Log/LogDetails.php +++ b/lib/private/Log/LogDetails.php @@ -108,7 +108,7 @@ public function logDetailsAsJSON(string $app, $message, int $level): string { if (is_string($value)) { $testEncode = json_encode($value, JSON_UNESCAPED_SLASHES); if ($testEncode === false) { - $entry[$key] = utf8_encode($value); + $entry[$key] = mb_convert_encoding($value, 'UTF-8', mb_detect_encoding($value)); } } }