[Mono.DataConverter] Make it easier to use in PCL libraries
authorMiguel de Icaza <miguel@gnome.org>
Fri, 19 Dec 2014 19:55:09 +0000 (14:55 -0500)
committerMiguel de Icaza <miguel@gnome.org>
Fri, 19 Dec 2014 19:55:25 +0000 (14:55 -0500)
mcs/class/corlib/Mono/DataConverter.cs

index 8dfdbd165674c8f9022c78f11589aa83178c6ba9..b29070bc34c3a72c3edbbeafa7dffc12d645f4f8 100644 (file)
@@ -39,6 +39,7 @@
 using System;
 using System.Collections;
 using System.Text;
+using System.Collections.Generic;
 
 #pragma warning disable 3021
 
@@ -462,7 +463,11 @@ namespace Mono {
                                        n = 2;
                                        break;
                                case '7':
+#if PCL
+                                       e = Encoding.GetEncoding ("utf-7");
+#else
                                        e = Encoding.UTF7;
+#endif
                                        n = 1;
                                        break;
                                case 'b':
@@ -470,11 +475,19 @@ namespace Mono {
                                        n = 2;
                                        break;
                                case '3':
+#if PCL
+                                       e = Encoding.GetEncoding ("utf-32");
+#else
                                        e = Encoding.GetEncoding (12000);
+#endif
                                        n = 4;
                                        break;
                                case '4':
+#if PCL
+                                       e = Encoding.GetEncoding ("utf-32BE);
+#else
                                        e = Encoding.GetEncoding (12001);
+#endif
                                        n = 4;
                                        break;
                                        
@@ -510,7 +523,7 @@ namespace Mono {
                static public IList Unpack (string description, byte [] buffer, int startIndex)
                {
                        DataConverter conv = CopyConv;
-                       ArrayList result = new ArrayList ();
+                       var result = new List<object> ();
                        int idx = startIndex;
                        bool align = false;
                        int repeat = 0, n;