From e785566e1af8995bcebb4b74aeecdd06f52313dc Mon Sep 17 00:00:00 2001 From: Deyan Ardi <60816261+deyan-ardi@users.noreply.github.com> Date: Tue, 14 May 2024 15:35:35 +0800 Subject: [PATCH] fix: replace Lfm.php, change method translateFromUtf8 --- src/Lfm.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Lfm.php b/src/Lfm.php index 2094f159..1ee26000 100644 --- a/src/Lfm.php +++ b/src/Lfm.php @@ -233,10 +233,27 @@ public function allowShareFolder() */ public function translateFromUtf8($input) { + // Disabled if ($this->isRunningOnWindows()) { $input = iconv('UTF-8', mb_detect_encoding($input), $input); } + // Replace with this + if ($this->isRunningOnWindows()) { + // $input = iconv('UTF-8', mb_detect_encoding($input), $input); + + if (is_array($input)) { + foreach ($input as $k => $i) { + $rInput[] = iconv('UTF-8', mb_detect_encoding($i), $i); + } + } else { + $rInput = $input; + } + } else { + $rInput = $input; + } + + return $rInput; return $input; }