case UTF8Encoding.UTF8_CODE_PAGE:
return UTF8;
-#if NET_2_0
+#if NET_2_0 && !NET_2_1
case UTF32Encoding.UTF32_CODE_PAGE:
return UTF32;
case UnicodeEncoding.BIG_UNICODE_CODE_PAGE:
return BigEndianUnicode;
+#if !NET_2_1
case Latin1Encoding.ISOLATIN_CODE_PAGE:
return ISOLatin1;
-
+#endif
default: break;
}
-
+#if !NET_2_1
// Try to obtain a code page handler from the I18N handler.
Encoding enc = (Encoding)(InvokeI18N ("GetEncoding", codepage));
if (enc != null) {
#endif
return enc;
}
-
+#endif // !NET_2_1
// We have no idea how to handle this code page.
throw new NotSupportedException
(String.Format ("CodePage {0} not supported", codepage.ToString ()));
return e;
}
+#if !NET_2_1
+
public static Encoding GetEncoding (int codepage,
EncoderFallback encoderFallback, DecoderFallback decoderFallback)
{
return e;
}
+#endif // !NET_2_1
+
static EncodingInfo [] encoding_infos;
// FIXME: As everyone would agree, this implementation is so *hacky*
"utf_7", "csunicode11utf7", "unicode_1_1_utf_7",
"unicode_2_0_utf_7", "x_unicode_1_1_utf_7",
"x_unicode_2_0_utf_7",
-
+
UTF8Encoding.UTF8_CODE_PAGE,
"utf_8", "unicode_1_1_utf_8", "unicode_2_0_utf_8",
"x_unicode_1_1_utf_8", "x_unicode_2_0_utf_8",
UnicodeEncoding.BIG_UNICODE_CODE_PAGE,
"unicodefffe", "utf_16be",
-
+#if !NET_2_1
#if NET_2_0
UTF32Encoding.UTF32_CODE_PAGE,
"utf_32", "UTF_32LE", "ucs_4",
Latin1Encoding.ISOLATIN_CODE_PAGE,
"iso_8859_1", "latin1"
+#endif // !NET_2_1
};
// Get an encoding object for a specific web encoding name.
if (converted == ((string)encodings [i]))
return GetEncoding (code);
}
-
+#if !NET_2_1
// Try to obtain a web encoding handler from the I18N handler.
Encoding enc = (Encoding)(InvokeI18N ("GetEncoding", name));
if (enc != null) {
if (type != null) {
return (Encoding)(Activator.CreateInstance (type));
}
-
+#endif
// We have no idea how to handle this encoding name.
throw new ArgumentException (String.Format ("Encoding name '{0}' not "
+ "supported", name), "name");
case 3: code_page = UTF8Encoding.UTF8_CODE_PAGE; break;
case 4: code_page = UnicodeEncoding.UNICODE_CODE_PAGE; break;
case 5: code_page = UnicodeEncoding.BIG_UNICODE_CODE_PAGE; break;
+#if !NET_2_1
case 6: code_page = Latin1Encoding.ISOLATIN_CODE_PAGE; break;
+#endif
}
defaultEncoding = GetEncoding (code_page);
}
}
}
+#if !NET_2_1
+
// Get the ISO Latin1 encoding object.
private static Encoding ISOLatin1
{
}
}
+#endif
+
// Get the standard UTF-7 encoding object.
#if ECMA_COMPAT
private
}
}
-#if NET_2_0
+#if NET_2_0 && !NET_2_1
// Get the standard little-endian UTF-32 encoding object.
public static Encoding UTF32
{