public static function getEncoding($file = null, $default = 'utf-8') {
		if (!function_exists('finfo_open')) {
			return $default;
		}
		$finfo = finfo_open(FILEINFO_MIME_ENCODING);
		$encoding = finfo_file($finfo, $file);
		finfo_close($finfo);
		if ($encoding !== false) {
			return $encoding;
		}
		return $default;
	}