2009-09-22 Sebastien Pouliot <sebastien@ximian.com>
authorSebastien Pouliot <sebastien@ximian.com>
Tue, 22 Sep 2009 13:34:24 +0000 (13:34 -0000)
committerSebastien Pouliot <sebastien@ximian.com>
Tue, 22 Sep 2009 13:34:24 +0000 (13:34 -0000)
* Encoding.cs: Remove UTF32, Latin1 and custom (loaded code)
encodings for NET_2_1

svn path=/trunk/mcs/; revision=142397

mcs/class/corlib/System.Text/ChangeLog
mcs/class/corlib/System.Text/Encoding.cs

index b5dc930823d312a26f1d7a3a6773c3d318987b68..056c214630a33287db1a8c5415ae508a076b5e16 100644 (file)
@@ -1,3 +1,8 @@
+2009-09-22  Sebastien Pouliot  <sebastien@ximian.com>
+
+       * Encoding.cs: Remove UTF32, Latin1 and custom (loaded code)
+       encodings for NET_2_1
+
 2009-07-28  Miguel de Icaza  <miguel@novell.com>
 
        * UTF8Encoding.cs: Small optimization, reuse the static
index d1f1ac898ed7c576a610e47dba8696eb4ab5891e..c33bb3f75064b18a5d660358eb8fa72069d34a2b 100644 (file)
@@ -463,7 +463,7 @@ public abstract class Encoding
                        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;
 
@@ -477,12 +477,13 @@ public abstract class Encoding
                        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) {
@@ -516,7 +517,7 @@ public abstract class Encoding
 #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 ()));
@@ -533,6 +534,8 @@ public abstract class Encoding
                return e;
        }
 
+#if !NET_2_1
+
        public static Encoding GetEncoding (int codepage,
                EncoderFallback encoderFallback, DecoderFallback decoderFallback)
        {
@@ -563,6 +566,8 @@ public abstract class Encoding
                return e;
        }
 
+#endif // !NET_2_1
+
        static EncodingInfo [] encoding_infos;
 
        // FIXME: As everyone would agree, this implementation is so *hacky*
@@ -626,7 +631,7 @@ public abstract class Encoding
                        "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",
@@ -637,7 +642,7 @@ public abstract class Encoding
 
                        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",
@@ -648,6 +653,7 @@ public abstract class Encoding
 
                        Latin1Encoding.ISOLATIN_CODE_PAGE,
                        "iso_8859_1", "latin1"
+#endif // !NET_2_1
                };
 
        // Get an encoding object for a specific web encoding name.
@@ -673,7 +679,7 @@ public abstract class Encoding
                        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) {
@@ -697,7 +703,7 @@ public abstract class Encoding
                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");
@@ -915,7 +921,9 @@ public abstract class Encoding
                                                                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);
                                                        }
@@ -938,6 +946,8 @@ public abstract class Encoding
                }
        }
 
+#if !NET_2_1
+
        // Get the ISO Latin1 encoding object.
        private static Encoding ISOLatin1
        {
@@ -955,6 +965,8 @@ public abstract class Encoding
                }
        }
 
+#endif
+
        // Get the standard UTF-7 encoding object.
 #if ECMA_COMPAT
        private
@@ -1053,7 +1065,7 @@ public abstract class Encoding
                }
        }
 
-#if NET_2_0
+#if NET_2_0 && !NET_2_1
        // Get the standard little-endian UTF-32 encoding object.
        public static Encoding UTF32
        {