[corlib] Fix commonly used encoding names
authorMarek Safar <marek.safar@gmail.com>
Mon, 30 Mar 2015 16:33:33 +0000 (18:33 +0200)
committerMarek Safar <marek.safar@gmail.com>
Mon, 30 Mar 2015 16:34:40 +0000 (18:34 +0200)
external/referencesource
mcs/class/corlib/ReferenceSources/Environment.cs
mcs/class/corlib/Test/System.Text/EncodingTest.cs

index bcee91f8a0212e687db4d1d1a906f1f97e775051..6f3639cbf1a09e7c5bb6ff1a3b3e4752d00f17fc 160000 (submodule)
@@ -1 +1 @@
-Subproject commit bcee91f8a0212e687db4d1d1a906f1f97e775051
+Subproject commit 6f3639cbf1a09e7c5bb6ff1a3b3e4752d00f17fc
index d4ea3c890b7db85e06b2c8b71dc801deb5890ecd..afdf9315a473de132cfac18ac90ea5d9ac96930c 100644 (file)
@@ -28,5 +28,15 @@ namespace System
                {
                        return string.Format (CultureInfo.InvariantCulture, key, values);
                }
+
+               internal static string GetResourceStringEncodingName (int codePage)
+               {
+                       switch (codePage) {
+                       case 1200: return GetResourceString ("Globalization.cp_1200");
+                       case 1201: return GetResourceString ("Globalization.cp_1201");
+                       case 65001: return GetResourceString ("Globalization.cp_65001");
+                       default: return codePage.ToString (CultureInfo.InvariantCulture);
+                       }
+               }
        }
 }
\ No newline at end of file
index aa13bf4a867fa7b2a12a983f5bc0c50d61358746..c5b932be3b420be58b2e2fecc738c81d9755af6b 100644 (file)
@@ -37,7 +37,6 @@ namespace MonoTests.System.Text
        public class EncodingTest
        {
                [Test]
-               [Category ("NotWorking")]
                [ExpectedException (typeof (NotSupportedException))]
                public void IsBrowserDisplay ()
                {
@@ -46,7 +45,6 @@ namespace MonoTests.System.Text
                }
 
                [Test]
-               [Category ("NotWorking")]
                [ExpectedException (typeof (NotSupportedException))]
                public void IsBrowserSave ()
                {
@@ -55,7 +53,6 @@ namespace MonoTests.System.Text
                }
 
                [Test]
-               [Category ("NotWorking")]
                [ExpectedException (typeof (NotSupportedException))]
                public void IsMailNewsDisplay ()
                {
@@ -64,7 +61,6 @@ namespace MonoTests.System.Text
                }
 
                [Test]
-               [Category ("NotWorking")]
                [ExpectedException (typeof (NotSupportedException))]
                public void IsMailNewsSave ()
                {
@@ -126,5 +122,11 @@ namespace MonoTests.System.Text
                {
                        Encoding.GetEncoding ((string) null);
                }
+
+               [Test]
+               public void EncodingName ()
+               {
+                       Assert.AreEqual ("Unicode (UTF-8)", Encoding.UTF8.EncodingName);
+               }
        }
 }