public static void Main()
var testString = "ÃÄÀÁÅÆÇÈÉÊËÌÍÎÏ";
var testString2 = "M=G!T-CS#D(A)E1%2+2.3~Y_QW";
var testString3 = "測試鍵號";
char[] invalidFileChars = Path.GetInvalidFileNameChars();
foreach (char s in invalidFileChars)
testString = testString.Replace(s, '-');
foreach (char s in invalidFileChars)
testString2 = testString2.Replace(s, '-');
foreach (char s in invalidFileChars)
testString3 = testString3.Replace(s, '-');
Console.WriteLine(testString);
Console.WriteLine(testString2);
Console.WriteLine(testString3);