From 1c102ac0d51469c9c4dd245b82ff8a3cc485a67e Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Wed, 9 Dec 2009 17:38:57 +0000 Subject: [PATCH] 2009-12-09 Chris Toshok * Encoding.cs (get_Default): moonlight defaults to UTF8, not UTF8Unmarked. svn path=/branches/mono-2-6/mcs/; revision=147922 --- mcs/class/corlib/System.Text/ChangeLog | 5 +++++ mcs/class/corlib/System.Text/Encoding.cs | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/mcs/class/corlib/System.Text/ChangeLog b/mcs/class/corlib/System.Text/ChangeLog index 61d5f47ed4d..07ca6eabda9 100644 --- a/mcs/class/corlib/System.Text/ChangeLog +++ b/mcs/class/corlib/System.Text/ChangeLog @@ -1,3 +1,8 @@ +2009-12-09 Chris Toshok + + * Encoding.cs (get_Default): moonlight defaults to UTF8, not + UTF8Unmarked. + 2009-10-06 Sebastien Pouliot * Encoding.cs: Remove normalization methods for Moonlight 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; -- 2.11.4.GIT