This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// this file is supposed to be in UTF-8 without BOM | |
function isRunningOnWindows() { | |
$os = php_uname('s'); //PHP_OS see https://stackoverflow.com/q/1482260/3995261 | |
return preg_match('#win#i',$os) ? true : false; | |
} | |
function fixFilenameEncoding($name) { | |
// seemingly is needed on Windows only because filename encoding is not utf-8 | |
return isRunningOnWindows() ? mb_convert_encoding($name, "windows-1251", "utf-8") : $name; | |
} |