所有平台均使用Windows上的特殊字符过滤规则
This commit is contained in:
parent
2299241d9d
commit
fb81212da5
|
@ -53,10 +53,12 @@ namespace N_m3u8DL_RE.Util
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static char[] InvalidChars = "34,60,62,124,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,58,42,63,92,47"
|
||||||
|
.Split(',').Select(s => (char)int.Parse(s)).ToArray();
|
||||||
public static string GetValidFileName(string input, string re = ".", bool filterSlash = false)
|
public static string GetValidFileName(string input, string re = ".", bool filterSlash = false)
|
||||||
{
|
{
|
||||||
string title = input;
|
string title = input;
|
||||||
foreach (char invalidChar in Path.GetInvalidFileNameChars())
|
foreach (char invalidChar in InvalidChars)
|
||||||
{
|
{
|
||||||
title = title.Replace(invalidChar.ToString(), re);
|
title = title.Replace(invalidChar.ToString(), re);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue