Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mcs/class/corlib/System.Text/Encoding.cs')
-rw-r--r--mcs/class/corlib/System.Text/Encoding.cs8
1 files changed, 8 insertions, 0 deletions
diff --git a/mcs/class/corlib/System.Text/Encoding.cs b/mcs/class/corlib/System.Text/Encoding.cs
index e3060c5b677..fa2e3e4d997 100644
--- a/mcs/class/corlib/System.Text/Encoding.cs
+++ b/mcs/class/corlib/System.Text/Encoding.cs
@@ -931,12 +931,20 @@ public abstract class Encoding
defaultEncoding = GetEncoding (code_page);
}
} catch (NotSupportedException) {
+#if NET_2_1 && !MONOTOUCH
+ defaultEncoding = UTF8;
+#else
// code_page is not supported on underlying platform
defaultEncoding = UTF8Unmarked;
+#endif
} catch (ArgumentException) {
// code_page_name is not a valid code page, or is
// not supported by underlying OS
+#if NET_2_1 && !MONOTOUCH
+ defaultEncoding = UTF8;
+#else
defaultEncoding = UTF8Unmarked;
+#endif
}
#if NET_2_0
defaultEncoding.is_readonly = true;