Skip to content

Commit 96feff7

Browse files
authored
Fix Windows bug (#12)
* Fix Windows bug * Fix comment
1 parent 309b849 commit 96feff7

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/Lfm.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,19 @@ public function allowShareFolder()
184184
/**
185185
* Translate file name to make it compatible on Windows.
186186
*
187-
* @param string $input Any string.
188-
* @return string
187+
* @param array|string $input
188+
* @return array|string
189189
*/
190190
public function translateFromUtf8($input)
191191
{
192192
if ($this->isRunningOnWindows()) {
193-
$input = iconv('UTF-8', mb_detect_encoding($input), $input);
193+
if (is_array($input)) {
194+
for($i = 0; $i < count($input); $i++) {
195+
$input[$i] = iconv('UTF-8', mb_detect_encoding($input[$i]), $input[$i]);
196+
}
197+
} else {
198+
$input = iconv('UTF-8', mb_detect_encoding($input), $input);
199+
}
194200
}
195201

196202
return $input;

0 commit comments

Comments
 (0)