[corlib] Let XI and XM define their own default encoding [#29928]
authorSebastien Pouliot <sebastien@xamarin.com>
Wed, 27 May 2015 17:35:38 +0000 (13:35 -0400)
committerSebastien Pouliot <sebastien@xamarin.com>
Wed, 27 May 2015 17:35:38 +0000 (13:35 -0400)
605192528de1a9c9c95a97bc5a2de7d3c85b322d used UTF8Unmarked for MONOTOUCH
and XAMMAC. However it's initialized differently (than the old UTF8) and
caused unit test regressions in System and System.Net.Http unit tests

This new logic moves the default encoding creation into the products
themselves.

mcs/class/corlib/System.Text/EncodingHelper.cs
mcs/class/corlib/monotouch_runtime_corlib.dll.sources [new file with mode: 0644]

index f077e44e254a78f4f836c0b1d5f68e64d5f0bc14..8e797d8cdc5eb74dc970940a6cc5ff1aabafc196 100644 (file)
@@ -7,7 +7,7 @@ using System.Security;
 namespace System.Text
 {
 
-internal static class EncodingHelper
+internal static partial class EncodingHelper
 {
        //
        // Only internal, to be used by the class libraries: Unmarked and non-input-validating
@@ -71,6 +71,7 @@ internal static class EncodingHelper
        [MethodImpl (MethodImplOptions.InternalCall)]
        extern internal static string InternalCodePage (ref int code_page);
 
+#if !(MONOTOUCH || XAMMAC)
        internal static Encoding GetDefaultEncoding ()
        {
                Encoding enc = null;
@@ -105,6 +106,7 @@ internal static class EncodingHelper
                                                }
                return enc;
        }
+#endif
 
        // Loaded copy of the "I18N" assembly.  We need to move
        // this into a class in "System.Private" eventually.
diff --git a/mcs/class/corlib/monotouch_runtime_corlib.dll.sources b/mcs/class/corlib/monotouch_runtime_corlib.dll.sources
new file mode 100644 (file)
index 0000000..9e173da
--- /dev/null
@@ -0,0 +1 @@
+#include corlib.dll.sources
\ No newline at end of file