public/js/kcfinder/lib/helper_file.php
static function normalizeFilename($filename) {
        $string = htmlentities($filename, ENT_QUOTES, 'UTF-8');
        if (strpos($string, '&') !== false)
            $filename = html_entity_decode(preg_replace('~&([a-z]{1,2})(?:acute|cedil|circ|grave|lig|orn|ring|slash|tilde|uml);~i', '$1', $string), ENT_QUOTES, 'UTF-8');
        $filename = trim(preg_replace('~[^0-9a-z\.\- ]~i', "_", $filename));
        return $filename;
    }
static function normalizeFilename($filename) {
        $string = htmlentities($filename, ENT_QUOTES, 'UTF-8');
        if (strpos($string, '&') !== false)
            $filename = html_entity_decode(preg_replace('~&([a-z]{1,2})(?:acute|cedil|circ|grave|lig|orn|ring|slash|tilde|uml);~i', '$1', $string), ENT_QUOTES, 'UTF-8');
        $filename = trim(preg_replace('~[^0-9a-z\.\- ]~i', "_", $filename));
        return $filename;
    }
Normalize given filename. Accented characters becomes non-accented and
removes any other special characters. Usable for non-unicode filesystems
@param $filename
@return string