I'm working with ContentType
class to parse content type (type + encoding
) of a webpage.
I'm noticed that this input fails (FormatException
):
text/html; charset: windows-1255
This is the code:
using System.Net.Mime;
//...
ContentType ct;
try
{
ct = new ContentType(content_type);
}
catch (FormatException ex)
{
return eFileType.Unknown;
}
Why it's throwing FormatException
?