public static function getFilterURL($filename, $fromCharset, $toCharset = null)
    {
        if ( $toCharset === null ) {
            return sprintf('php://filter/convert.mbstring.encoding.%s/resource=%s', $fromCharset, $filename);
        } else {
            return sprintf('php://filter/convert.mbstring.encoding.%s:%s/resource=%s', $fromCharset, $toCharset, $filename);
        }
    }