From 0ce938a7a19209a1613b257a1d2f1343905b0573 Mon Sep 17 00:00:00 2001 From: Siad Ardroumli Date: Sat, 3 Oct 2020 15:59:54 +0200 Subject: [PATCH] Update WindowsFileSystem.php (#1413) Fixed #1399 --- classes/phing/system/io/WindowsFileSystem.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/classes/phing/system/io/WindowsFileSystem.php b/classes/phing/system/io/WindowsFileSystem.php index d3782ba730..a590ec8298 100644 --- a/classes/phing/system/io/WindowsFileSystem.php +++ b/classes/phing/system/io/WindowsFileSystem.php @@ -548,7 +548,11 @@ public function compare(PhingFile $f1, PhingFile $f2) */ private function fixEncoding($strPath) { - $codepage = 'CP' . trim(strstr(setlocale(LC_CTYPE, ''), '.'), '.'); + $charSet = trim(strstr(setlocale(LC_CTYPE, ''), '.'), '.'); + if ($charSet === 'utf8') { + return $strPath; + } + $codepage = 'CP' . $charSet; if (function_exists('iconv')) { $strPath = iconv('UTF-8', $codepage . '//IGNORE', $strPath); } elseif (function_exists('mb_convert_encoding')) {