byteOrderMark = true;
}
public UnicodeEncoding (bool bigEndian, bool byteOrderMark)
+ : this (bigEndian, byteOrderMark, false)
+ {
+ }
+
+#if NET_2_0
+ public
+#endif
+ UnicodeEncoding (bool bigEndian, bool byteOrderMark, bool throwOnInvalidBytes)
: base ((bigEndian ? BIG_UNICODE_CODE_PAGE : UNICODE_CODE_PAGE))
{
+#if NET_2_0
+ if (throwOnInvalidBytes)
+ SetFallbackInternal (null, new DecoderExceptionFallback ());
+ else
+ SetFallbackInternal (null, new DecoderReplacementFallback ("\uFFFD"));
+#endif
+
this.bigEndian = bigEndian;
this.byteOrderMark = byteOrderMark;
windows_code_page = UNICODE_CODE_PAGE;
}
-#if NET_2_0
- [MonoTODO ("Implement throwOnInvalidBytes")]
- public UnicodeEncoding (bool bigEndian, bool byteOrderMark, bool throwOnInvalidBytes)
- : this (bigEndian, byteOrderMark)
- {
- }
-#endif
-
// Get the number of bytes needed to encode a character buffer.
public override int GetByteCount (char[] chars, int index, int count)
{