public static string RemoveIllegalCharacters(string text)
{
if (string.IsNullOrEmpty(text))
return text;
text = text.Replace(":", "-");
text = text.Replace("/", "-");
text = text.Replace("?", "-");
text = text.Replace("#", "-");
text = text.Replace("[", "-");
text = text.Replace("]", "-");
text = text.Replace("@", string.Empty);
text = text.Replace(".", string.Empty);
text = text.Replace("\"", "-");
text = text.Replace("&", "-");
text = text.Replace("%", "-");
// e-Musty inserted - removing some more illegal chars
text = text.Replace(",", string.Empty);
text = text.Replace("–", "-");
text = text.Replace("á", "a");
text = text.Replace("Á", "A");
text = text.Replace("é", "e");
text = text.Replace("É", "E");
text = text.Replace("í", "i");
text = text.Replace("Í", "I");
text = text.Replace("ó", "o");
text = text.Replace("Ó", "O");
text = text.Replace("ö", "o");
text = text.Replace("Ö", "O");
text = text.Replace("ő", "o");
text = text.Replace("Ő", "O");
text = text.Replace("ú", "u");
text = text.Replace("Ú", "U");
text = text.Replace("ü", "u");
text = text.Replace("Ü", "U");
text = text.Replace("ű", "u");
text = text.Replace("Ű", "U");
// eof e-Musty inserted
return HttpUtility.UrlEncode(text.Replace(" ", "-"));
}