+2007-02-01 Gert Driesen <drieseng@users.sourceforge.net>
+
+ * Encoding.cs: Enabled ArgumentException in GetEncoding (string) again.
+ In Encoding.Default, catch both ArgumentException and NotSupportException.
+
2007-02-01 Atsushi Enomoto <atsushi@ximian.com>
* Encoding.cs : the change broke the build, so reverted part of it.
}
// We have no idea how to handle this encoding name.
- throw new NotSupportedException (String.Format ("Encoding name '{0}' not "
- + "supported", name));
+ throw new ArgumentException (String.Format ("Encoding name '{0}' not "
+ + "supported", name), "name");
}
#endif // !ECMA_COMPAT
defaultEncoding = GetEncoding (code_page);
}
} catch (NotSupportedException) {
+ // code_page is not supported on underlying platform
+ defaultEncoding = UTF8Unmarked;
+ } catch (ArgumentException) {
+ // code_page_name is not a valid code page, or is
+ // not supported by underlying OS
defaultEncoding = UTF8Unmarked;
}
defaultEncoding.is_readonly = true;