private static IdnType ConvertStringToType(string idnType)
{
switch (idnType)
{
case "T":
return IdnType.Transitional;
case "N":
return IdnType.Nontransitional;
case "B":
return IdnType.Both;
default:
throw new ArgumentOutOfRangeException("idnType", "Unknown idnType");
}
}