Skip to content

Commit a172b37

Browse files
committed
fix iconv bug while processing non-utf8 folders
1 parent a774800 commit a172b37

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/traits/LfmHelpers.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ private function removeLastSlash($path)
298298
public function translateFromUtf8($input)
299299
{
300300
if ($this->isRunningOnWindows()) {
301-
$input = iconv('UTF-8', 'BIG5', $input);
301+
$input = iconv('UTF-8', mb_detect_encoding($input), $input);
302302
}
303303

304304
return $input;
@@ -313,7 +313,7 @@ public function translateFromUtf8($input)
313313
public function translateToUtf8($input)
314314
{
315315
if ($this->isRunningOnWindows()) {
316-
$input = iconv('BIG5', 'UTF-8', $input);
316+
$input = iconv(mb_detect_encoding($input), 'UTF-8', $input);
317317
}
318318

319319
return $input;

0 commit comments

Comments
 (0)