#if NET_2_0
[ComVisible (true)]
#endif
-[MonoTODO ("Fix serialization compatibility with MS.NET")]
+[MonoTODO ("Serialization format not compatible with .NET")]
public class UnicodeEncoding : Encoding
{
// Magic numbers used by Windows for Unicode.
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)
{
return count;
}
+ [ComVisible (false)]
+ public override Encoder GetEncoder ()
+ {
+ return(base.GetEncoder ());
+ }
+
// Get the maximum number of bytes needed to encode a
// specified number of characters.
public override int GetMaxByteCount (int charCount)